Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

event-to-promise

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-to-promise - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

dist/event-to-promise.js

2

index.js

@@ -73,3 +73,3 @@ 'use strict'

if (!opts || !opts.ignoreErrors) {
addEvent(opts && opts.error || 'error', reject)
addEvent((opts && opts.error) || 'error', reject)
}

@@ -76,0 +76,0 @@ })

{
"name": "event-to-promise",
"version": "0.7.0",
"version": "0.8.0",
"license": "MIT",

@@ -10,4 +10,4 @@ "description": "Create a promise waiting for an event",

],
"homepage": "https://github.com/julien-f/event-to-promise",
"bugs": "https://github.com/julien-f/event-to-promise/issues",
"homepage": "https://github.com/JsCommunity/event-to-promise",
"bugs": "https://github.com/JsCommunity/event-to-promise/issues",
"author": {

@@ -20,18 +20,24 @@ "name": "Julien Fontanet",

"type": "git",
"url": "https://github.com/julien-f/event-to-promise"
"url": "https://github.com/JsCommunity/event-to-promise"
},
"devDependencies": {
"mocha": "^2.2.5",
"must": "^0.13.1",
"browserify": "^14.1.0",
"husky": "^0.13.1",
"jest": "^19.0.2",
"native-promise-only": "^0.8.1",
"standard": "^6.0.4"
"standard": "^9.0.0",
"uglify-js": "^2.8.3"
},
"scripts": {
"commitmsg": "yarn test",
"dev-test": "jest --watch",
"lint": "standard",
"prepublish": "mkdir -p dist && browserify -s eventToPromise index.js | uglifyjs -c > dist/event-to-promise.js",
"posttest": "npm run lint",
"test": "mocha index.spec.js"
"test": "jest"
},
"files": [
"dist/",
"index.js"
]
}
# event-to-promise
[![Build Status](https://img.shields.io/travis/julien-f/event-to-promise/master.svg)](http://travis-ci.org/julien-f/event-to-promise)
[![Dependency Status](https://david-dm.org/julien-f/event-to-promise/status.svg?theme=shields.io)](https://david-dm.org/julien-f/event-to-promise)
[![devDependency Status](https://david-dm.org/julien-f/event-to-promise/dev-status.svg?theme=shields.io)](https://david-dm.org/julien-f/event-to-promise#info=devDependencies)
[![Build Status](https://img.shields.io/travis/JsCommunity/event-to-promise/master.svg)](http://travis-ci.org/JsCommunity/event-to-promise)
[![Dependency Status](https://david-dm.org/JsCommunity/event-to-promise/status.svg?theme=shields.io)](https://david-dm.org/JsCommunity/event-to-promise)
[![devDependency Status](https://david-dm.org/JsCommunity/event-to-promise/dev-status.svg?theme=shields.io)](https://david-dm.org/JsCommunity/event-to-promise#info=devDependencies)
> Create a promise waiting for an event
## Installation
## Install
### Node & [Browserify](http://browserify.org/)/[Webpack](https://webpack.js.org/)
Download [manually](https://github.com/julien-f/event-to-promise/releases) or with package-manager.
Installation of the [npm package](https://npmjs.org/package/event-to-promise):
#### [npm](https://npmjs.org/package/event-to-promise)
```
> npm install --save event-to-promise
```
Then require the package:
```javascript
var eventToPromise = require('event-to-promise');
```
npm install --save event-to-promise
### Browser
You can directly use the build provided at [unpkg.com](https://unpkg.com):
```html
<script src="https://unpkg.com/event-to-promise@0.8/dist/event-to-promise.js"></script>
```
This library requires promises support, for Node versions prior to 0.12 [see
this page](https://github.com/julien-f/js-promise-toolbox#usage) to
enable them.
## Example
```javascript
var eventToPromise = require('event-to-promise')
function createServer (port) {

@@ -52,4 +59,2 @@ var server = require('http').createServer()

```js
import eventToPromise from 'event-to-promise'
async function createServer (port) {

@@ -78,2 +83,6 @@ var server = require('http').createServer()

This library requires promises support, for Node versions prior to 0.12 [see
this page](https://github.com/JsCommunity/js-promise-toolbox#usage) to
enable them.
### eventToPromise(emitter, event, [options]) => Promise

@@ -176,3 +185,3 @@

- report any [issue](https://github.com/julien-f/event-to-promise/issues)
- report any [issue](https://github.com/JsCommunity/event-to-promise/issues)
you've encountered;

@@ -179,0 +188,0 @@ - fork and create a pull request.

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