https://github.com/frontainer/npm-tasks
power-up npm scripts for task runner
https://github.com/frontainer/npm-tasks
npm-scripts
Last synced: about 1 year ago
JSON representation
power-up npm scripts for task runner
- Host: GitHub
- URL: https://github.com/frontainer/npm-tasks
- Owner: frontainer
- Created: 2016-08-22T06:48:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-08T01:22:25.000Z (over 9 years ago)
- Last Synced: 2025-03-20T00:41:23.851Z (about 1 year ago)
- Topics: npm-scripts
- Language: JavaScript
- Size: 24.4 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- [default-greyhounds](https://github.com/frontainer/default-greyhounds)