node-fibers-synchronize-helper
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -109,3 +109,3 @@ var sync = require('synchronize'); | ||
if (returnParamsNameArr) | ||
params.push(sync.defers.apply(sync, returnParamsNameArr)) | ||
params.push(sync.defers.apply(obj, returnParamsNameArr)) | ||
else | ||
@@ -154,2 +154,2 @@ params.push(sync.defer()) | ||
sync.fiber(fn, done); | ||
} | ||
} |
106
package.json
{ | ||
"name": "node-fibers-synchronize-helper", | ||
"version": "1.0.1", | ||
"description": "helper for synchronize promise and callback", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"dependencies": { | ||
"synchronize": "2.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git" | ||
}, | ||
"keywords": [ | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "https://github.com/zakdav/node-fibers-synchronize-helper", | ||
"scope": null, | ||
"escapedName": null, | ||
"name": null, | ||
"rawSpec": "https://github.com/zakdav/node-fibers-synchronize-helper", | ||
"spec": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"type": "hosted", | ||
"hosted": { | ||
"type": "github", | ||
"ssh": "git@github.com:zakdav/node-fibers-synchronize-helper.git", | ||
"sshUrl": "git+ssh://git@github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"httpsUrl": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"gitUrl": "git://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"shortcut": "github:zakdav/node-fibers-synchronize-helper", | ||
"directUrl": "https://raw.githubusercontent.com/zakdav/node-fibers-synchronize-helper/master/package.json" | ||
} | ||
}, | ||
"/srv/GitHub" | ||
] | ||
], | ||
"_from": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"_id": "node-fibers-synchronize-helper@1.0.2", | ||
"_inCache": true, | ||
"_location": "/node-fibers-synchronize-helper", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "https://github.com/zakdav/node-fibers-synchronize-helper", | ||
"scope": null, | ||
"escapedName": null, | ||
"name": null, | ||
"rawSpec": "https://github.com/zakdav/node-fibers-synchronize-helper", | ||
"spec": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"type": "hosted", | ||
"hosted": { | ||
"type": "github", | ||
"ssh": "git@github.com:zakdav/node-fibers-synchronize-helper.git", | ||
"sshUrl": "git+ssh://git@github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"httpsUrl": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"gitUrl": "git://github.com/zakdav/node-fibers-synchronize-helper.git", | ||
"shortcut": "github:zakdav/node-fibers-synchronize-helper", | ||
"directUrl": "https://raw.githubusercontent.com/zakdav/node-fibers-synchronize-helper/master/package.json" | ||
} | ||
}, | ||
"_requiredBy": [ | ||
"#USER" | ||
], | ||
"_resolved": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git#36c80ec63584e819963d3695dc910c977ae7f707", | ||
"_shasum": "79e7eff828ff1b6dad8484cb37354c3f87058d44", | ||
"_shrinkwrap": null, | ||
"_spec": "https://github.com/zakdav/node-fibers-synchronize-helper", | ||
"_where": "/srv/GitHub", | ||
"author": { | ||
"name": "davide.zaccheo@gmail.com" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/zakdav/node-fibers-synchronize-helper/issues" | ||
}, | ||
"dependencies": { | ||
"synchronize": "2.0.0" | ||
}, | ||
"description": "helper for synchronize promise and callback", | ||
"devDependencies": {}, | ||
"gitHead": "36c80ec63584e819963d3695dc910c977ae7f707", | ||
"homepage": "https://github.com/zakdav/node-fibers-synchronize-helper#readme", | ||
"keywords": [ | ||
"fiber", | ||
@@ -24,10 +77,17 @@ "synchronize", | ||
"callback hell" | ||
], | ||
"author": "davide.zaccheo@gmail.com", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/zakdav/node-fibers-synchronize-helper/issues" | ||
}, | ||
"homepage": "https://github.com/zakdav/node-fibers-synchronize-helper#readme" | ||
} | ||
"license": "ISC", | ||
"main": "index.js", | ||
"name": "node-fibers-synchronize-helper", | ||
"optionalDependencies": {}, | ||
"readme": "# node-fibers-synchronize-helper\n\nThis helper uses synchronize module (https://www.npmjs.com/package/synchronize) and helps to manage promises and callbacks, you will be able to synch code and catch exceptions \n\n\nPromise management:\n```\nvar synchProm = require('node-fibers-synchronize-helper')\n \nvar testSynch = function () {\n try{\n //promise function call\n var db = synchProm.executePromiseFiberFn(MongoClient, MongoClient.connect, url)\n //get synch object and call promise function\n var dbProm = synchProm.getSynchPromiseObj(db);\n var stats = dbProm.executePromiseFiber(db.stats)\n\n //cursor.toArray promise version\n var cursor = collection_test.find({});\n var resProm = synchProm.executePromiseFiberFn(cursor, cursor.toArray)\n\n\n\n }catch(e){\n console.log(e)\n }\n\n}\n\n\nsynchProm.executeSynch(testSynch, function (err, res) {\n if (err)\n console.log(\"err\", err)\n else\n console.log(\"OK:\", JSON.stringify(res, null, 4))\n})\n\n```\n\n\n\nCallback management:\n```\nvar synchProm = require('node-fibers-synchronize-helper')\n \nvar testSynch = function () {\n try{\n\n //cursor.toArray callback version\n cursor = collection_test.find({});\n var resCb = synchProm.executeFiberFn(cursor, cursor.toArray)\n assert.notEqual(null, resCb);\n\n //callback with param\n resCb = synchProm.executeFiberFn(cursor, cursor.count, true, {\n skip: 1\n })\n\n //multiparam result callback\n var resMultiCb = synchProm.executeFiberFnMultiParamCb(this, multiParamCB, ['res1', 'res2'], \"a\", \"b\", \"c\") \n\n\n }catch(e){\n console.log(e)\n }\n\n}\n\n\nsynchProm.executeSynch(testSynch, function (err, res) {\n if (err)\n console.log(\"err\", err)\n else\n console.log(\"OK:\", JSON.stringify(res, null, 4))\n})\n```\n\n\n\n\n\n\n\n\n", | ||
"readmeFilename": "README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zakdav/node-fibers-synchronize-helper.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "1.0.2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15215
223