Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibmaek/pure-fun
😊 A collection of Javascript pure functions/helpers with 0 dependencies
https://github.com/thibmaek/pure-fun
esm esnext functional-programming helper immutable javascript pure-function utils
Last synced: 3 months ago
JSON representation
😊 A collection of Javascript pure functions/helpers with 0 dependencies
- Host: GitHub
- URL: https://github.com/thibmaek/pure-fun
- Owner: thibmaek
- License: mit
- Created: 2017-09-14T12:25:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-10T17:22:10.000Z (about 4 years ago)
- Last Synced: 2024-10-12T21:05:52.149Z (4 months ago)
- Topics: esm, esnext, functional-programming, helper, immutable, javascript, pure-function, utils
- Language: JavaScript
- Size: 1.22 MB
- Stars: 14
- Watchers: 3
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
😊 pure-fun
A collection of JavaScript pure functions/helpers with zero dependencies.
# Installing
```console
npm install pure-fun
yarn add pure-fun
```## Usage
```js
import PureFun from 'pure-fun';
const mapArr = PureFun.arrays.getMappedArray({ key: 'value' });import { arrays } from 'pure-fun';
const rnd = arrays.pickRandom([1, 2, 3])import sleep from 'pure-fun/async';
(async () => {
await sleep(1000);
console.log('Slept 1s')
})();
```### Development
The dev env for this is Node LTS/latest with ESM (import/export) syntax as a standard.
Typescript is used to ensure type safety + documentation
Linting is done with eslint and testing with jest.You can run tests locally with `npm t`. Every PR also builds on Travis CI under these circumstances.