Comparing version 0.1.2 to 0.1.3
{ | ||
"name" : "listen", | ||
"version" : "0.1.2", | ||
"version" : "0.1.3", | ||
"description" : "Wait for the results of multiple callbacks", | ||
@@ -9,3 +9,3 @@ "author" : "Maximilian Antoni (http://maxantoni.de)", | ||
"engines" : { | ||
"node" : "0.6" | ||
"node" : ">=0.6" | ||
}, | ||
@@ -20,5 +20,6 @@ "scripts" : { | ||
"devDependencies" : { | ||
"utest" : "0.0.x", | ||
"urun" : "0.0.x", | ||
"sinon" : "1.3.x" | ||
"utest" : "~0.0.6", | ||
"urun" : "~0.0.6", | ||
"sinon" : "~1.3.4", | ||
"uglify-js" : "~1.2.6" | ||
}, | ||
@@ -25,0 +26,0 @@ "nomo" : { |
@@ -11,3 +11,3 @@ # listen.js | ||
npm install listen | ||
```` | ||
``` | ||
@@ -24,3 +24,11 @@ ## Usage | ||
// ... do async stuff with callbacks | ||
/* | ||
* Do async stuff with callbacks. | ||
* | ||
* Callbacks follow the Node.js convention. They expect an error or null as | ||
* the first argument and an optional value as the second: | ||
* | ||
* Fail: callback(new Error('ouch!')); | ||
* Return: callback(null, 'some return value'); | ||
*/ | ||
@@ -41,14 +49,9 @@ listener.then(function (err, values) { | ||
`listen()` - creates a new listener. | ||
- `listen()` - creates a new listener. | ||
- `listen(values)` - creates a new listener with initial values. The given argument must be an array. | ||
- `listener()` - creates a new callback associated with the listener. Throws if called after `then`. | ||
- `listener.then(func)` - invokes the given function once all callbacks where invoked. Throws if already called. | ||
- `listener.push(value)` - pushes a value to the internal values array. Throws if called after `then`. | ||
- `listener.err(error)` - adds an error to the internal error list. Throws if called after `then`. | ||
`listen(values)` - creates a new listener with initial values. The given argument must be an array. | ||
`listener()` - creates a new callback associated with the listener. Throws if called after `then`. | ||
`listener.then(func)` - invokes the given function once all callbacks where invoked. Throws if already called. | ||
`listener.push(value)` - pushes a value to the internal values array. Throws if called after `then`. | ||
`listener.err(error)` - adds an error to the internal error list. Throws if called after `then`. | ||
## Run tests | ||
@@ -60,3 +63,3 @@ | ||
## Compile for browsers | ||
## Compile for browsers and minify | ||
@@ -63,0 +66,0 @@ This requires [nomo.js](https://github.com/mantoni/nomo.js). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
15705
67
4
1