rhodash
Version:
A deadly simple alternative to lodash
76 lines (52 loc) β’ 4.87 kB
Markdown
# rhodash (Οπ)
[](https://github.com/KoichiKiyokawa/rhodash/actions/workflows/ci.yml)
[](https://codecov.io/gh/KoichiKiyokawa/rhodash)
[](https://www.npmjs.com/package/rhodash)


[](#)
> A deadly simple alternative to lodash.
## Feature
- π No dependencies
- β‘οΈ Lightweight
- πͺ Typescript first(written in TypeScript and suitable for TypeScript users)
- π Tree shakable
- π JSDoc available (easy to use).

- πΊοΈ Sourcemap and declarationMap is available (You can jump directly to the `.ts` file of this library instead of `d.ts`).

## Install
```sh
npm install rhodash
# or yarn add rhodash
```
## Usage
You can simply try [here](https://stackblitz.com/edit/typescript-ze7myy?file=index.ts).
### ES Module
```ts
import { pick, omit } from 'rhodash'
pick({ a: 1, b: 2, c: 3 }, ['a', 'b']) // { a: 1, b: 2 }
omit({ a: 1, b: 2, c: 3 }, ['a', 'b']) // { c: 3 }
```
### CommonJS
```ts
const { pick, omit } = require('rhodash')
pick({ a: 1, b: 2, c: 3 }, ['a', 'b']) // { a: 1, b: 2 }
omit({ a: 1, b: 2, c: 3 }, ['a', 'b']) // { c: 3 }
```
### Browser
```html
<script src="https://unpkg.com/rhodash@2.2.0"></script>
<script>
document.write(rhodash.pick({ a: 1, b: 2, c: 3 }, ['a', 'b']))
</script>
```
## API
You can see utility methods document [here](https://rhodash.vercel.app/).
## Comparison
| | [rhodash](https://github.com/KoichiKiyokawa/rhodash) | [Lodash](https://github.com/lodash/lodash) | [just](https://github.com/angus-c/just) | [rambda](https://github.com/selfrefactor/rambda) |
| ----------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| οΈπ¦οΈ Size of whole the package |  |  | -<br>You should install each packages one by one. |  |
| π Easy-to-understand JSDoc | β
<br>(It has both description and example) | β | β | :warning: <br>(It only has description) |
| π¦ Ease of jumping to the original source | π | π€<br>(You can, but it is complex) | β | β |
| :pencil2: Remarks | This library | Most popular, but huge. | You need to install the corresponding packages one by one. It will increase the number of lines in package.json. | Designed for functional programming, so it has many extra functions for those who do not need functional programming. In addition, some of the functions have a different API than Lodash's |