0.0.9 • Published 4 years ago

iotjs-async v0.0.9

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
4 years ago

IOTJS-ASYNC

GitHub forks License NPM Build Status FOSSA Status dependencies Status

NPM

INTRODUCTION:

Lightweight implementation of async's for IoT.js

So far only waterfall function is implemented.

USAGE:

USING NODEJS:

Running from sources tree is straightforward, but each step will be detailed.

npm start
#| node example
#| [ 4, 2 ]

USING IOTJS:

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

iotjs_modules

RESOURCES:

LICENSE:

FOSSA Status