0.1.2 • Published 5 years ago

lafy v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

lafy

GitHub license David

lafy is a ridiculously small module that adds a simpler way to promisify instance methods. It can obviously be used on normal promisifiable methods:

const fs = require('fs');
const lafy = require('lafy');

// Don't want to bother promisifying a function ?
let contents = await lafy(cb => fs.readFile("/etc/passwd", cb));

// Oh no, this class' methods use callbacks ;(
// The only way to promisify methods would be to bind them to an instance
const userManager = new UserManager(/* ... */);
let users = await lafy(cb => userManager.getUsers(cb));
// Much simpler if you only need to do this once or twice !

Download

npm install lafy

Bugs & Suggestions

If you notice any bug or have a suggestion, please tell me about it in the issues, it will help everyone!

Tests

Tests are created with mocha and asserted with chai.expect and chai-as-promised.

You can run the suite using

npm test

License

lafy is licensed under the very permissive MIT License. You may use it for commercial projects if you comply to the license.

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago