npm-tasks
power-up npm scripts for task runner
Last updated 4 years ago by frontainer .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-tasks 
SYNC missed versions from official npm registry.

npm-tasks

power-up npm scripts for task runner.

Required

Node.js =< 5.0

Install

Local Install

npm i npm-tasks --save-dev

Global Install

npm i npm-tasks -g

Usage

create task.conf.js

module.exports = {
    config: {
        sassSrc: "/path/to/sass",
        destSass: "/dest/to/sass"
    },
    task: {
        "sass": "node-sass ${sassSrc} --output ${destSass}"
    }
};
  • config: Variables in task command. Replacing ${key} by value.
  • task: Task command. npm-tasks adds node_modules/.bin to the PATH provided to scripts.

Example

package.json

{
    ...
    scripts: {
        "build": "tasks build:*",
        "build:task1": "tasks sass",
        "build:task2": "npm-tasks sass"
    }
}

You can use wildcard. ex tasks build:* -> tasks build:tasks1 & tasks build:tasks2

tasks is npm-tasks alias.

npm run sass

npm run sass -> tasks sass -> node-sass /path/to/sass --output /dest/to/sass

Sync Tasks

{
    ...
    scripts: {
        "build": "tasks sass postcss",
        "sass": "tasks sass",
        "postcsss": "tasks postcss"
    }
}

Case Example

Current Tags

  • 1.4.4                                ...           latest (4 years ago)

9 Versions

  • 1.4.4                                ...           4 years ago
  • 1.4.3                                ...           4 years ago
  • 1.4.2                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 3
Last Day 1
Last Week 0
Last Month 12
Dependencies (5)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |