Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sodiray/radash
Functional utility library - modern, simple, typed, powerful
https://github.com/sodiray/radash
functions hacktoberfest javascript javascript-library typescript
Last synced: 26 days ago
JSON representation
Functional utility library - modern, simple, typed, powerful
- Host: GitHub
- URL: https://github.com/sodiray/radash
- Owner: sodiray
- License: mit
- Created: 2020-12-23T21:14:25.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-08T02:20:31.000Z (6 months ago)
- Last Synced: 2024-05-10T03:24:54.946Z (6 months ago)
- Topics: functions, hacktoberfest, javascript, javascript-library, typescript
- Language: TypeScript
- Homepage: https://radash-docs.vercel.app
- Size: 675 KB
- Stars: 3,636
- Watchers: 16
- Forks: 139
- Open Issues: 72
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Radash
:loud_sound: `/raw-dash/`
Functional utility library - modern, simple, typed, powerful
## Install
```
yarn add radash
```## Usage
A very brief kitchen sink. See the full documentation [here](https://radash-docs.vercel.app).
```ts
import * as _ from 'radash'const gods = [{
name: 'Ra',
power: 'sun',
rank: 100,
culture: 'egypt'
}, {
name: 'Loki',
power: 'tricks',
rank: 72,
culture: 'norse'
}, {
name: 'Zeus',
power: 'lightning',
rank: 96,
culture: 'greek'
}]_.max(gods, g => g.rank) // => ra
_.sum(gods, g => g.rank) // => 268
_.fork(gods, g => g.culture === 'norse') // => [[loki], [ra, zeus]]
_.sort(gods, g => g.rank) // => [ra, zeus, loki]
_.boil(gods, (a, b) => a.rank > b.rank ? a : b) // => ra_.objectify(
gods,
g => g.name.toLowerCase(),
g => _.pick(g, ['power', 'rank', 'culture'])
) // => { ra, zeus, loki }const godName = _.get(gods, g => g[0].name)
const [err, god] = await _.try(api.gods.findByName)(godName)
const allGods = await _.map(gods, async ({ name }) => {
return api.gods.findByName(name)
})
```## Contributing
Contributions are welcome and appreciated! Check out the [contributing guide](./.github/contributing.md) before you dive in.