Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajhsu/then-ify
Make your synchronous function thenable.
https://github.com/ajhsu/then-ify
javascript nodejs
Last synced: 29 days ago
JSON representation
Make your synchronous function thenable.
- Host: GitHub
- URL: https://github.com/ajhsu/then-ify
- Owner: ajhsu
- License: mit
- Created: 2016-10-14T03:37:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-03T07:20:01.000Z (over 7 years ago)
- Last Synced: 2024-12-22T09:34:58.903Z (about 1 month ago)
- Topics: javascript, nodejs
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# then-ify
Make your synchronous function thenable.
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![License][license-image]][license-url]## Install
```bash
$ npm install then-ify --save
```## Example
```javascript
var thenify = require('then-ify');// Here we have a synchronous function
function syncFunction(input) { return input * input; }// Now you can call .then with then-ify
thenify(syncFunction)(3)
.then(function(output){
// output = 9
});
```[npm-image]: https://img.shields.io/npm/v/then-ify.svg
[npm-url]: https://www.npmjs.com/package/then-ify
[travis-image]: https://img.shields.io/travis/ajhsu/then-ify.svg
[travis-url]: https://travis-ci.org/ajhsu/then-ify
[license-image]: https://img.shields.io/github/license/ajhsu/then-ify.svg
[license-url]: LICENSE