Socket
Socket
Sign inDemoInstall

promisify-event

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    promisify-event

Promisify EventEmitter's event.


Version published
Weekly downloads
190K
decreased by-18.74%
Maintainers
1
Install size
18.7 kB
Created
Weekly downloads
 

Readme

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

Last updated on 10 Dec 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc