Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
dnode-promise
Advanced tools
Use promises on your dnode server.
npm install --save dnode-promise
This package exports one function (take a look inside!) that takes an object of promise-methods and returns an object of dnode style methods.
server:
var dnode = require('dnode');
var dnodep = require('dnode-promise');
var server = dnode(dnodep.toDnode({
transform: function (s) {
return Promise.resolve(s.replace(/[aeiou]{2,}/, 'oo').toUpperCase());
}
}));
server.listen(5004);
client:
var dnode = require('dnode');
var dnodep = require('dnode-promise');
var d = dnode.connect(5004);
d.on('remote', function (methods) {
var remote = dnodep.toPromise(methods);
remote.transform('beep')
.then(function (s) {
console.log('beep => ' + s);
d.end();
});
});
If you want a specific promise to be returned from the remote calls,
supply it to the second argument of the toPromise
method, example:
var BBPromise = require('bluebird');
// ...
var remote = dnodep.toPromise(methods, BBPromise);
remote.transform('beep')
.then(function (s) {
console.log('beep => ' + s);
d.end();
});
// ...
Copyright 2015 Koen Schmeets (hello@koenschmeets.nl)
This project is free software released under the MIT license: http://www.opensource.org/licenses/mit-license.php
FAQs
Helper for using promises on a dnode server
The npm package dnode-promise receives a total of 11 weekly downloads. As such, dnode-promise popularity was classified as not popular.
We found that dnode-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.