Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
event-to-promise
Advanced tools
Create a promise waiting for an event
Download manually or with package-manager.
npm install --save event-to-promise
var eventToPromise = require('event-to-promise');
function createServer(port) {
var server = require('http').createServer();
server.listen(port);
// The server will be returned once it has started listening.
//
// If an error happened, it will be forwarded instead.
return eventToPromise(server, 'listening').then(function () {
return server;
});
};
// Using plain promise.
createServer(80).then(function (server) {
console.log('Server listening on http://localhost:80/');
}).catch(function (error) {
console.error('Server could not start:', error);
});
// Even better using generators!
require('bluebird').coroutine(function *() {
try {
var server = yield createServer(80);
console.log('Server listening on http://localhost:80/');
} catch (error) {
console.error('Server could not start:', error);
}
})();
Required
Type: object
The event emitter you want to watch an event on.
Required
Type: string
The name of the event you want to watch.
Type: boolean
Default: undefined
This option controls how a listener's parameters are resolved by its promise.
If true, the parameters are resolved as an array. If false, the first parameter is resolved. If undefined (the default), an array is resolved if there's more than one parameter; otherwise, the first parameter is resolved.
Type: string
Default: "error"
The name of the event which rejects the promise.
Type: boolean
Default: false
Whether the error event should be ignored and not reject the promise.
Contributions are very welcome, either on the documentation or on the code.
You may:
ISC © Julien Fontanet
FAQs
Create a promise waiting for an event
The npm package event-to-promise receives a total of 54,104 weekly downloads. As such, event-to-promise popularity was classified as popular.
We found that event-to-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.