Minimalistic ES7 async/await based task runner.
Zero dependencies. It expects the consumer to provide all the necessary transforms, preserving full access to the original APIs and flexibility.
Create a task.js
file at the root of your project:
const task = require('taks')
task('styles', async function () {
await postcss('./entry.css', './dist/output.css')
})
task('scripts', async function () {
await rollup('./entry.js', './dist/output.js')
})
task('build', async function () {
task.parallel(['scripts', 'styles'])
})
task.run(process.argv[2])
Then run node task build
to trigger the build
task.
For a more complete example showing more complex usage of flow control, and implemenntation of rollup, postcss and uglify transforms, see this sample task.js file.
This is the spiritual successor of flour and cake-async that originally used CoffeeScript and a bit of trickery to create async
tasks back in 2013. Inspired by taskr.
MIT Licensed (http://ricardo.mit-license.org)