Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnaudsm/array-deluxe
Superpowers for your JavaScript arrays π¦Έ
https://github.com/arnaudsm/array-deluxe
array functional-programming groupby list pipes
Last synced: 3 days ago
JSON representation
Superpowers for your JavaScript arrays π¦Έ
- Host: GitHub
- URL: https://github.com/arnaudsm/array-deluxe
- Owner: arnaudsm
- License: mit
- Created: 2022-10-08T23:40:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-09T09:38:05.000Z (about 2 years ago)
- Last Synced: 2024-10-27T21:56:48.365Z (16 days ago)
- Topics: array, functional-programming, groupby, list, pipes
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/array-deluxe
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Array-Deluxe π¦ΈββοΈ
Superpowers for your JavaScript arrays
```js
import 'array-deluxe'[1,2,3].map(x => x+1).unique().shuffle().mean()
```# Usage
## Import
```js
import 'array-deluxe'
// OR
require('array-deluxe')
```## Number functions
```js
const list = [1,1,3]
list.max() // 3
list.min() // 1
list.sum() // 5
list.median() // 1
list.mean() // 2.5
list.unique() // [1,3]
list.shuffle() // [1,3,1]
```
## Object functions
```js
const people = [
{name:"snap", age:21},
{name:"pop", age:23},
{name:"crackle", age:21},
];
people.select("name") // ["snap","pop","crackle"]
people.max("age") // 23
people.min("age") // 21
people.sum("age") // 65
people.median("age") // 21
people.mean("age") // 21.6..
```# Todo
- Tests
- TypeScript support