New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

promise-callbacks

Package Overview
Dependencies
Maintainers
22
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-callbacks - npm Package Compare versions

Comparing version

to
3.3.0

.idea/codeStyles/codeStyleConfig.xml

2

CHANGELOG.md
## Release History
* 3.3.0 Add callAsync function
* 3.2.2 Actually use explicit exports per #16.

@@ -4,0 +6,0 @@ * 3.2.1 Use explicit exports per #16.

2

package.json
{
"name": "promise-callbacks",
"version": "3.2.2",
"version": "3.3.0",
"description": "Utilities to help convert a callback-using codebase to promises.",

@@ -5,0 +5,0 @@ "engines": {

@@ -56,5 +56,15 @@ # promise-callbacks

What happened there is that `promise.deferred()` took the result of `respondWithDelay`, as a
What happened there is that `promise.defer()` took the result of `respondWithDelay`, as a
callback, and `resolved`/`rejected` the associated `Promise`.
It's also possible to achieve the above more succinctly using the `callAsync` function, as follows:
```js
const { callAsync } = require('promise-callbacks');
async function foo() {
console.log(await callAsync(respondWithDelay));
}
```
### Variadic arguments

@@ -198,4 +208,4 @@

// => Hello, world!
defer.promise.then((message) => console.log(message));
defer.resolve('Hello, world!');
def.promise.then((message) => console.log(message));
def.resolve('Hello, world!');
```

@@ -202,0 +212,0 @@

@@ -5,2 +5,3 @@ 'use strict';

const static_ = require('./static');
const callAsync = require('./callAsync');
const deferred = require('./deferred');

@@ -25,2 +26,3 @@ const defer = require('./defer');

exports.unpatchPromise = unpatchPromise;
exports.callAsync = callAsync;
exports.deferred = deferred;

@@ -27,0 +29,0 @@ exports.defer = defer;