po

4.5.2 • Public • Published

po = promiseify + co

NPM version Build status Test coverage

usage

var co = require('co');
var po = require('po');

var fsReadFile = po(fs.readFile, fs);
var fsStat = po(fs.stat, fs);

co(function* Ab() {
    var a = yield fsReadFile(path.join(__dirname, './a.md'), 'utf-8');
    var b = yield fsStat(path.join(__dirname, './b.md'));

    return [a, b.size];
}).then(function (ret) {
    console.log(ret);
    // => [a.md' data, b.md' size]
}).catch(function (err) {
    console.log(err.stack);
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.5.2
    42
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 4.5.2
    42
  • 4.5.1
    0
  • 4.5.0
    0

Package Sidebar

Install

npm i po

Weekly Downloads

42

Version

4.5.2

License

none

Last publish

Collaborators

  • cloudcome