Lightweight implementation of async's for IoT.js
So far only waterfall function is implemented.
Running from sources tree is straightforward, but each step will be detailed.
npm test
[ 4, 2 ]
or
nodejs example
It's very similar to nodejs (just the path should be fully specified for iotjs-1.0)
iotjs example/index.js
[4,2]
Using module in your own project can be done easily by adding a git submodule (because IoT.js does not provide its own packaging tool):
git submodule add https://github.com/rzr/iotjs-async iotjs-modules/iotjs-async
git commit -sam 'Import iotjs-async dependency'
git submodule update --init
Or rely on IoT.js community repo to track supported versions (If you don't want the whole repo, extra post install cleanup scripts might be needed):
git submodule add https://github.com/samsung/iotjs-modules
git commit -sam 'Import iotjs-modules dependency'
git submodule update --init
Alternatively, code can be imported using node's npm package manager tool:
npm install iotjs-async
IOTJS_EXTRA_MODULE_PATH=./node_modules/ iotjs node_modules/iotjs-async/example
Client side, path can be adjusted or prefixed to support both runtime:
var async;
if (process.iotjs) {
async = require('iotjs-async');
} else {
async = require('async');
}
IOTJS_EXTRA_MODULE_PATH=.../iotjs-async/../ iotjs ${example}
NODE_PATH=.../iotjs-async/../ node ${example}