hum

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

hum

Play with grunt.

Features

  • humcould run gruntinside a specified cwd and search tasks from the given paths.
  • huminstances will be executed in series to prevent grunt (which is composed of global variables and singletons) fucking up with himself.
  • humprovides a programmatical way to run grunttasks.

Installation

npm install hum --save

Usage

Actually, humis an alternative of Gruntfile.jsand 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 PATHand NODE_PATHdo.

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_PATHto 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.

Repository

https://github.com/kaelzhang/node-hum


上一篇:deferrer
下一篇:put-in

相关推荐

  • quickthumb

    On the fly, thumbnail creation middleware for express. QuickThumb QuickThumb is an on the fly, th...

    2 个月前
  • lg-thumbnail

    Thumbnail module for lightgallery. travis(https://travisci.org/sachinchoolur/lgthumbnail.svg?branch...

    2 年前
  • humps

    UnderscoretocamelCase converter (and vice versa) for strings and object keys in JavaScript. humps B...

    2 年前
  • humanlike

    Emulates human to generates random timeseries of web session activity Emulates human to generate ra...

    4 个月前
  • humanize-url

    Humanize a URL: → humanizeurl Build Status(https://travisci.org/sindresorhus/humanizeurl.svg?bra...

    2 年前
  • humanize-string

    Convert a camelized/dasherized/underscored string into a humanized one: → humanizestring Build S...

    1 年前
  • humanize-plus

    A simple utility library for making the web more humane. Humanize Plus npm version(https://img.sh...

    2 年前
  • humanize-number

    Humanize a number (1000000 1,000,000) humanizenumber Humanize a number Installation ...

    2 年前
  • humanize-ms

    transform humanize time to ms humanizems NPM versionnpmimagenpmurl build statustravisimagetravisu...

    2 年前
  • humanize-list

    Comma delimit an array for human readability, the Oxford comma is optional. humanizelist Build Sta...

    1 年前

官方社区

扫码加入 JavaScript 社区