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 start
#| node example
#| [ 4, 2 ]
It's very similar to nodejs (just the path should be fully specified for iotjs-1.0)
make start
#| 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
Note, ff you want to preseve path of NPM async module (require 'async'), just clone is directory of samename (to align node_modules/async)
git submodule add https://github.com/rzr/iotjs-async iotjs_modules/async
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:
cat example.js
var async;
if (process.iotjs) {
async = require('iotjs-async');
} else {
async = require('async');
}
IOTJS_EXTRA_MODULE_PATH=.../iotjs-async/../ iotjs example.js
NODE_PATH=.../iotjs-async/../ node example.js
If we want to avoid to change client's source, then use environment variables:
cat example.js
var async = require('async');
NODE_PATH=.../iotjs-async/iotjs node example.js
IOTJS_EXTRA_MODULE_PATH=.../iotjs-async/iotjs iotjs example.js
- https://github.com/rzr/iotjs-async#
- https://www.npmjs.com/package/iotjs-async#
- https://libraries.io/npm/iotjs-async#
- http://iotjs.net/#
- https://github.com/jerryscript-project/iotjs-modules/
- https://github.com/rzr/webthing-iotjs/wiki/IotJs#
- https://www.npmjs.com/package/async#
- https://www.npmjs.com/package/async-lite#
- SamDelgado/async-lite#1
- https://github.com/tizenteam/async-lite#
- https://github.com/TizenTeam/bmp085-sensor#
- dbridges/bmp085-sensor#7
- https://mastodon.social/@tizenhelper/103775679164369666