Socket
Socket
Sign inDemoInstall

promisify-event

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promisify-event

Promisify EventEmitter's event.


Version published
Weekly downloads
234K
increased by4.89%
Maintainers
1
Weekly downloads
 
Created
Source

promisify-event

Build Status

Promisify EventEmitter's event.

Install

npm install promisify-event

Usage

const promisifyEvent = require('promisify-event');

// Promisify server's `listening` event:
promisify(server, `listening`).then(() => {
  // ...
});

// Promisify `error` event. `error` event always rejects the promise:
promisify(server, 'error').catch(() => {
  // ...
});

// Cancel event subscription and promise (it will be never fulfilled):
var listeningPromise = promisify(server, `listening`);

listeningPromise.cancel();

listeningPromise.then(() => {
  // Will never happen
});

Author

Ivan Nikulin (ifaaan@gmail.com)

Keywords

FAQs

Package last updated on 10 Dec 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc