1.10.1 • Published 10 months ago

putil-promisify v1.10.1

Weekly downloads
2,260
License
MIT
Repository
github
Last release
10 months ago

putil-promisify

NPM Version NPM Downloads Build Status Test Coverage Dependencies DevDependencies

Simple and lightweight utility fore transforming callback functions to Promises

Installation

  • npm install putil-promisify --save

Usage

promisify(resolver)

const Promisify = require('./');
const fs = require('fs');

// Transform callback function to promise
const promise = Promisify.fromCallback((cb) => {
  fs.readdir('./', cb);
});

// Do what ever you want with promise
promise.then(result => {
  console.log(result);
}).catch(e => {
  console.error(e);
});

Node Compatibility

  • node >= 6.x;

License

MIT

1.10.1

10 months ago

1.9.0

1 year ago

1.8.6

1 year ago

1.10.0

1 year ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.7.3

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.4

3 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

6 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago