sinless
Adapts sync functions to expose async api and leaves async functions unchanged..
Last updated 7 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sinless 
SYNC missed versions from official npm registry.

sinless build status

testling badge

sinless [ˈsɪnlɪs] free from sin or guilt; innocent; pure

Wraps sync functions to make them non-blocking and leaves async functions unchanged.

var sinless = require('sinless')

function syncAdd (a, b) {
  return a + b;
}

var sinlessAdd = sinless(syncAdd, 3);
sinlessAdd(1, 3, function (err, res) {
  if (err) return console.error('err', err);
  console.log('res', res);
})

// res: 4

Status

Alpha use at your own risk ;). Partially implemented, aynchronousity deduced by function length at this point.

Installation

npm install sinless

API

License

MIT

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

2 Versions

  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |