Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaelzhang/node-simple-thenify
Make sure a function is thenable
https://github.com/kaelzhang/node-simple-thenify
javascript nodejs promise thenify
Last synced: 20 days ago
JSON representation
Make sure a function is thenable
- Host: GitHub
- URL: https://github.com/kaelzhang/node-simple-thenify
- Owner: kaelzhang
- License: other
- Created: 2017-01-13T10:42:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T13:40:07.000Z (over 7 years ago)
- Last Synced: 2024-04-15T12:33:03.922Z (7 months ago)
- Topics: javascript, nodejs, promise, thenify
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/kaelzhang/node-simple-thenify.svg?branch=master)](https://travis-ci.org/kaelzhang/node-simple-thenify)
# 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
```sh
$ npm install simple-thenify --save
```## Usage
```js
const thenify = require('simple-thenify')
const fn = thenify(x => x + 1)fn(1).then(console.log) // 2
```## License
MIT