A build tool for Node.js programs.
Install globally with
npm install -g treadmill
Or add to your local dependencies in
npm install --save treadmill
Say you have a project folder that looks something like this:
├── frontend│ └── scripts│ | ├── main.js│ | └── store.js| └── styles│ ├── main.scss│ └── buttons.scss├── public│ └── assets└── server└── server.js
You could write an asset build file for Treadmill in the root of your project as
build.js like this:
'use strict';const treadmill = ;const browserify = ;const sass = ;const task = treadmilltask;const Promise = treadmillPromise;const log = treadmilllog;;;;
And run it like this:
treadmill build.js build-assets
task() function like in the example above to create tasks.
task() takes 3 parameters:
The listed dependency tasks will be run first and the results passed into your handler (see Handler Function below).
Your Handler Function will be passed 2 arguments:
The first argument passed to your handler is called
args and it is an Immutable.Map of some useful default values as well as the results of all your dependencies. Since
args is an Immutable Object you'll need to get values from it using the getter like this:
const cwd = args.get('currentWorkingDirectory');
If you accept the
done argument like this:
Your task will not complete until
done() is called. If you pass an argument to
done() Treadmill will assume it is an error and report it as such. This is a Node.js convention.
Treadmill Knows Promises!
If you do not accept the
done argument in your handler like this:
Treadmill will assume that you returned a Promise from your Handler and will report the resolve or reject from that promise.
Copyright (c) 2013 - 2016 by Kris Walker firstname.lastname@example.org (http://www.kixx.name).
Unless otherwise indicated, all source code is licensed under the MIT license. See MIT-LICENSE for details.