Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xaqron/politify
A Javascript library that promises to run any function as you wish
https://github.com/xaqron/politify
function nodejs promise wish
Last synced: 1 day ago
JSON representation
A Javascript library that promises to run any function as you wish
- Host: GitHub
- URL: https://github.com/xaqron/politify
- Owner: Xaqron
- License: mit
- Created: 2018-11-09T08:44:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-09T09:12:45.000Z (over 6 years ago)
- Last Synced: 2023-12-23T15:30:04.633Z (about 1 year ago)
- Topics: function, nodejs, promise, wish
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Politify
Have you ever struggled how to implement a function to accomplish the desired task?
No hassle anymore. Pass your function to **politify** and make a wish about how you want the function works and... Viola!
**Eventually** you will get a function back that works as you expect.
## Install
```bash
npm i politify
```## Usage
```js
const politify = require('politify')const inc = a => a + 1
politify(inc)
.then((wishInc) => console.log(wishInc(1) === Infinity ? 'success' : 'failure'))
```