await-event
Advanced tools
Comparing version 1.0.0 to 2.0.0
12
index.js
@@ -0,8 +1,8 @@ | ||
'use strict' | ||
module.exports = function await(event) { | ||
var self = this | ||
return function (done) { | ||
if (event !== 'error') done = done.bind(null, null) | ||
self.once(event, done) | ||
} | ||
module.exports = function(event) { | ||
return new Promise((resolve, reject) => { | ||
const done = event === 'error' ? reject : resolve | ||
this.once(event, done) | ||
}) | ||
} |
{ | ||
"name": "await-event", | ||
"description": "yield an event with generators", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -18,3 +18,17 @@ "name": "Jonathan Ong", | ||
"await" | ||
], | ||
"scripts": { | ||
"test": "jest --forceExit", | ||
"test-cov": "jest --coverage --forceExit" | ||
}, | ||
"devDependencies": { | ||
"co": "^4.6.0", | ||
"jest": "^18.1.0" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
}, | ||
"files": [ | ||
"index.js" | ||
] | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
2590
2
2