hum

2019-10-12 admin

hum是什么

什么是hum,Hum, hum could run grunt inside a specified cwd and search tasks from the given paths.

hum使用教程帮助文档

hum NPM version Build Status Dependency Status

Play with grunt.

Features

  • hum could run grunt inside a specified cwd and search tasks from the given paths.
  • hum instances will be executed in series to prevent grunt (which is composed of global variables and singletons) fucking up with himself.
  • hum provides a programmatical way to run grunt tasks.

Installation

npm install hum --save

Usage

Actually, hum is an alternative of Gruntfile.js and supplies a bunch of promise-style APIs.

With hum, you could replace the code inside ‘Gruntfile.js’ with hum methods, and search available tasks only from your specified paths, as well as the PATH and NODE_PATH do.

So, it becomes possible for you to run a same tier of tasks for severial different projects.

var hum = require('hum');

hum({
	path: '</path/to/search>',
	cwd: 
})
.npmTasks('my-task')
.task('blah') // blah is defined in my-task
.init({
	// task name
	blah: {
		// target must be defined
		test: {
		}
	}
})
.options({
	verbose: true
})
.done(function(err){
})

Constructor: hum(options)

Creates a hum instance.

options.path

type path

The path(s) to search tasks from.

options.cwd

type path, default to the process.cwd.

It will be added to every target of each task configuration and will affect all configurations related to files, src, and dest.

options.strict_path

type Boolean, default to false

By default, hum will concat the NODE_PATH to the end of the path list.

.npmTasks(moduleName)

Similar to grunt.loadNpmTasks(moduleName)

.task(taskname)

Specifies the tasks to run, if no task is specified, hum will try to run the 'default' task.

.init(config)

Similar to grunt.initConfig(config)

.options(options)

Sets options for grunt cli.

.options({verbose: true}) is equivalent to grunt --verbose.

.done(callback)

The promised callback.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-77185.html

文章标题:hum

相关文章
Strange JavaScript behavior in CodePen with humongous arrays
TylerHShrekOverflow提出了一个问题:Strange JavaScript behavior in CodePen with humongous arrays,或许与您遇到的问题类似。 回答者Benjamin Gruenba...
2018-04-22
lg-thumbnail
lg-thumbnail是什么 什么是lg-thumbnail,Thumbnail module for lightgallery. lg-thumbnail官网:官网 lg-thumbnail文档:文档 lg-thumbnail源码仓库...
2018-08-30
humanize-url
humanize-url是什么 什么是humanize-url,Humanize a URL: http://sindresorhus.com → sindresorhus.com humanize-url官网:官网 humanize-u...
2018-09-29
human-size
human-size是什么 什么是human-size,human readable file size human-size官网:官网 human-size源码仓库:源码仓库 human-size下载地址:点此下载 点此下载2 hum...
2019-01-11
human-interval
human-interval是什么 什么是human-interval,Human readable time measurements human-interval官网:官网 human-interval源码仓库:源码仓库 human-...
2019-03-17
humanize-string
humanize-string是什么 什么是humanize-string,Convert a camelized/dasherized/underscored string into a humanized one: fooBar-Baz...
2019-03-23
git-parse-human
git-parse-human是什么 什么是git-parse-human,parse author and committer names from git commits git-parse-human官网:官网 git-parse-...
2019-03-29
humanize-list
humanize-list是什么 什么是humanize-list,Comma delimit an array for human readability, the Oxford comma is optional. humanize-...
2019-07-07
A human being,who loves football and music.
专栏 文章详情 &lt;div class=“post-topheader custom- pt0”&gt; &lt;div class=“mb20”&gt; &lt;div class=“block-for-right-border”...
2019-08-11
回到顶部