node-make
Version:
Make for Node.js
77 lines (58 loc) • 1.65 kB
Markdown
[](https://www.npmjs.com/package/node-make)
[](https://www.npmjs.com/package/node-make)
[](https://travis-ci.org/egoist/node-make)
[](http://packagequality.com/#?package=node-make)
It's neither [Jake](http://jakejs.com/) nor [Runfile](https://github.com/runfile/runfile), it's just Makefile and JavaScript.
```bash
npm install -g node-make
```
**makefile.js**
```javascript
// built-in Promisify node core api
// you can use 'mz' without installation
import fs from 'mz/fs'
log:
log('hi')
log('feel weird?')
for (let i of [1, 2, 3]) {
console.log(i)
}
// async/await
md@async:
const data = await fs.readFile('hello.md', 'utf8')
console.log(data)
// shell commands
publish:
exec('npm run build')
exec('npm test')
exec('npm publish')
// emit a task in a task
emit:
// callback is optional
emit('log', callback)
// single-line exec() commands short-hand
try:
// `argv` is global variable for accessing user input from cli
const message = argv.m || new Date()
> git add -A
> git commit -m "${message}"
> git push origin master
// multi-line exec() commands short-hand
source:
>>>
export PATH='$PATH:~/go'
echo $PATH
<<<
log:
// native color support
> echo ${'I love you'.red}
```
**command line**
```bash
mk [taskName]
```
MIT © [EGOIST](https://github.com/egoist)