2.0.0 • Published 6 years ago

unthenify v2.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

Un-thenify

NPM version NPM downloads Build status Test coverage

Callbackify a promise function. The logical reverse of thenify.

Installation

npm install unthenify --save

Usage

Wrap a function that usually returns a promise to accept callbacks.

import { unthenify } from 'unthenify'

const handler = unthenify(async function (payload) {
  // Do something...

  return true
})

// Use with callback-style.
handler({}, function (err, result) {
  console.log(err, result) //=> undefined, true
})

License

Apache 2.0

2.0.0

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago