event-to-promise
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
11154
5
94
190
6
48091
2
2