promisify-all-multi

1.0.0 • Public • Published

promisify-all-multi

NPM version Build status Test coverage Downloads

promisify-all with multiArgs always on the object.someMethodMulti property

Setup via NPM

npm install promisify-all-multi --save

Usage

import promisify from 'promisify-all-multi';
const object = {
  method(arg1, arg2, callback) {
    callback(
      null,
      arg1 + '!',
      arg2 + '@'
    );
  }
}
const promised = promisify(object);
 
promised.method('foo', 'bar')
  .then(results => console.log(results)) // 'foo!'
 
promised.methodMulti('foo', 'bar')
  .then(results => console.log(results)) // ['foo!', 'bar@']
 
// Using es6 destructuring:
promised.methodMulti('foo', 'bar')
  .then(([foo, bar]) => console.log({ foo, bar })) // {foo: 'foo!', bar: 'bar@'}

Readme

Keywords

none

Package Sidebar

Install

npm i promisify-all-multi

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.47 kB

Total Files

6

Last publish

Collaborators

  • kolodny