Nanoscale Parts Manufacturing
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

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);
});

install

npm i po

Downloadsweekly downloads

5

version

4.5.2

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar