Socket
Socket
Sign inDemoInstall

bluebird

Package Overview
Dependencies
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluebird - npm Package Compare versions

Comparing version 0.7.10-1 to 0.7.11-0

83

API.md

@@ -54,4 +54,5 @@ #API Reference

- [`.toJSON()`](#tojson---object)
- [`Promise.promisify(Function nodeFunction [, dynamic receiver])`](#promisepromisifyfunction-nodefunction--dynamic-receiver---function)
- [`Promise.promisify(Object target)`](#promisepromisifyobject-target---object)
- [`Promise.promisify(Function nodeFunction [, dynamic receiver])`](#promisepromisifyfunction-nodefunction--dynamic-receiver---function)
- [`Promise.promisifyAll(Object target)`](#promisepromisifyallobject-target---object)
- [`Promise.coroutine(GeneratorFunction generatorFunction)`](#promisecoroutinegeneratorfunction-generatorfunction---function)

@@ -172,3 +173,3 @@ - [`Promise.spawn(GeneratorFunction generatorFunction)`](#promisespawngeneratorfunction-generatorfunction---promise)

MyCustomError.prototype = Object.create(Error.prototype);
MyCustomError.constructor = MyCustomError;
MyCustomError.prototype.constructor = MyCustomError;
```

@@ -713,37 +714,2 @@

#####`Promise.promisify(Object target)` -> `Object`
Promisifies the entire object by going through the object and creating an async equivalent of each function on the object. The promisified method name will be the original method name postfixed with `Async`. Returns the input object.
Example:
```js
Promise.promisify(RedisClient.prototype);
//Later on, all redis client instances have promise returning functions:
redisClient.hexistsAsync("myhash", "field").then(function(v){
}).catch(function(e){
});
```
It also works on singletons or specific instances:
```js
var fs = Promise.promisify(require("fs"));
fs.readFileAsync("myfile.js", "utf8").then(function(contents){
console.log(contents);
}).catch(function(e){
console.error(e.stack);
});
```
Only enumerable own properties are considered. A specific object will only be promisified once. The target methods are assumed to conform to node.js callback convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. If the node method calls its callback with multiple success values, the fulfillment value will be an array of them.
If a method already has `"Async"` postfix, it will be duplicated. E.g. `getAsync`'s promisified name is `getAsyncAsync`.
#####`Promise.promisify(Function nodeFunction [, dynamic receiver])` -> `Function`

@@ -783,4 +749,43 @@

#####`Promise.promisify(Object target)` -> `Object`
This overload has been **deprecated**. The overload will continue working for now. The recommended method for promisifying multiple methods at once is [`Promise.promisifyAll(Object target)`]()
#####`Promise.promisifyAll(Object target)` -> `Object`
Promisifies the entire object by going through the object and creating an async equivalent of each function on the object. The promisified method name will be the original method name postfixed with `Async`. Returns the input object.
Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
Example:
```js
Promise.promisifyAll(RedisClient.prototype);
//Later on, all redis client instances have promise returning functions:
redisClient.hexistsAsync("myhash", "field").then(function(v){
}).catch(function(e){
});
```
It also works on singletons or specific instances:
```js
var fs = Promise.promisifyAll(require("fs"));
fs.readFileAsync("myfile.js", "utf8").then(function(contents){
console.log(contents);
}).catch(function(e){
console.error(e.stack);
});
```
Only enumerable own properties are considered. A specific object will only be promisified once. The target methods are assumed to conform to node.js callback convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. If the node method calls its callback with multiple success values, the fulfillment value will be an array of them.
If a method already has `"Async"` postfix, it will be duplicated. E.g. `getAsync`'s promisified name is `getAsyncAsync`.
#####`Promise.coroutine(GeneratorFunction generatorFunction)` -> `Function`

@@ -834,4 +839,6 @@

...
When called, the coroutine function will start an instance of the generator and returns a promise for its final value.
Doing `Promise.coroutine(function*(){})` is like using the C# `async` keyword to mark the function, with `yield` working as the `await` keyword. Promises are `Task`s.
Doing `Promise.coroutine(function*(){})` is almost like using the C# `async` keyword to mark the function, with `yield` working as the `await` keyword. Promises are somewhat like `Task`s.

@@ -838,0 +845,0 @@ #####`Promise.spawn(GeneratorFunction generatorFunction)` -> `Promise`

{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
"version": "0.7.10-1",
"version": "0.7.11-0",
"keywords": [

@@ -41,3 +41,2 @@ "promise",

"deferred": "~0.6.5",
"buster": "~0.6.12",
"rsvp": "~2.0.4",

@@ -44,0 +43,0 @@ "avow": "~2.0.1",

@@ -49,3 +49,8 @@ <a href="http://promisesaplus.com/">

###Browser support
Browsers that [implement ECMA-262, edition 5](http://en.wikipedia.org/wiki/Ecmascript#Implementations) and later are supported.
IE8 (ECMAS-262, edition 3) is supported if you include [es5-shim.js](https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js) and [es5-sham.js](https://github.com/kriskowal/es5-shim/blob/master/es5-sham.js).
#What are promises and why should I use them?

@@ -187,2 +192,4 @@

Keep the test tab active because some tests are timing-sensitive and will fail if the browser is throttling timeouts. Chrome will do this for example when the tab is not active.
##Benchmarks

@@ -189,0 +196,0 @@

Sorry, the diff of this file is too big to display

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