Home

Awesome

promise2thunk npmjs.com The MIT License

Convert (transform) promise to thunk, just like was in co@3

code climate standard code style travis build status coverage status dependency status

Install

npm i promise2thunk --save
npm test

Usage

For more use-cases see the tests

var promise2thunk = require('promise2thunk')
var parseJson = require('then-parse-json')

var promise = parseJson('{"foo":"bar"}')
var thunk = promise2thunk(promise)

thunk(function (err, res) {
  console.log(err) //=> null
  console.log(res) //=> { foo: 'bar' }
})

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github