simple-thenify

v1.0.2
Make sure a function is thenable.
simple-thenify

Build Status

simple-thenify

Make sure that a function will return a promise (thenable).

If a function does not return a promise, it will promise.resolve the return value.

Install

$ npm install simple-thenify --save

Usage

const thenify = require('simple-thenify')
const fn = thenify(x => x + 1)

fn(1).then(console.log) // 2

License

MIT

npm i simple-thenify

Metadata

  • MIT
  • >=4
  • kaelzhang
  • released 5/17/2017

Downloads

Maintainers