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
18
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 2.1.1 to 2.1.2

1

CHANGELOG.md
## Release History
* 2.1.2 Fix for Node < 7
* 2.0.0 Replace sync with deferred, add promisify, fix asCallback
* 1.0.0 Initial release

5

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

@@ -35,3 +35,6 @@ "engines": {

"jasmine-promises": "github:mixmaxhq/jasmine-promises#working_in_node"
},
"dependencies": {
"object.getownpropertydescriptors": "2.0.3"
}
}

@@ -111,2 +111,21 @@ # promise-callbacks

### Variadic callbacks
Much like `deferred`, you can receive multiple callback arguments by passing the `variadic` option to promisify. This also works with `promisify.methods` and `promisify.all`.
```js
const { promisify } = require('promise-callbacks');
function respondWithDelay(done) {
setTimeout(() => done(null, 3, 2, 1, 4), 2000);
}
const respondWithDelayPromised = promisify(respondWithDelay, {variadic: true});
async function foo() {
console.log(await respondWithDelayPromised());
// => [3, 2, 1, 4]
}
```
## For an object

@@ -113,0 +132,0 @@

@@ -27,2 +27,3 @@ /***************************************************************************************************

const callbackBuilder = require('./callbackBuilder');
const getOwnPropertyDescriptors = require('object.getownpropertydescriptors');

@@ -72,3 +73,3 @@ /**

});
return Object.defineProperties(fn, Object.getOwnPropertyDescriptors(orig));
return Object.defineProperties(fn, getOwnPropertyDescriptors(orig));
}

@@ -75,0 +76,0 @@

Sorry, the diff of this file is not supported yet

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