karmia-context
v0.8.0
Published
Karmia context module.
Downloads
5
Readme
karmia-context
Context module of Karmia JavaScript library
Installation
npm install karmia-context
Example
const karmia_context = require('karmia-context'),
context = new karmia_context();
Set parameter
context.set('key', 'value');
Get parameter
context.get('key');
Remove parameter
context.remove('key');
Create child context
const child_context = context.child();
Call function
const parameters = {key: value};
context.call(function, parameters, callback);
Get async function
const parameters = {key: value};
async.waterfall([
context.async(function, parameters);
], callback);
Get promise
co(function* () {
const parameters = {key: value};
return yield context.promise(function, parameters);
}).then(function () {});