promised-method
v1.0.0
Published
Turns a function into one that always returns a Promise a la Blubird's Promise.method.
Downloads
30,078
Readme
promised-method
Turns a function into one that always returns a Promise a la Blubird's Promise.method.
Usage
'use strict';
const promised = require('promised-method');
function Clazz() {}
Clazz.prototype.foo = promised(function(arg) {
if (!arg) {
throw new Error('need an arg!');
}
// ...
});
Testing
npm test
Contributing
Fork the repository. Committing directly against this repository is highly discouraged.
Make your modifications in a branch, updating and writing new unit tests as necessary in the
test
directory.Ensure that all tests pass with
npm test
rebase
your changes against master. Do not merge.Submit a pull request to this repository. Wait for tests to run and someone to chime in.
Code Style
This repository is configured with EditorConfig and ESLint rules.