# tily

> Fast, small and purely functional utility library

Latest version **2.23.2** (published 2024-09-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install tily
pnpm add tily
yarn add tily
bun add tily
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.23.2 |
| Published | 2024-09-17 |
| First published | 2021-06-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 511 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | TY |
| Maintainers | towyuan |
| Keywords | utils, ramda, lodash, underscore, curry, performance |

## Links

- npm: https://www.npmjs.com/package/tily
- Repository: https://github.com/betaly/tily
- Homepage: https://github.com/betaly/tily#readme
- Issues: https://github.com/betaly/tily/issues
- npm.io page: https://npm.io/package/tily

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 2.23.2 (latest) — 2024-09-17
- 2.22.8 — 2023-11-03
- 2.22.7 — 2023-11-01
- 2.22.6 — 2023-10-30
- 2.22.5 — 2023-10-18
- 2.22.4 — 2023-10-17
- 2.22.3 — 2023-10-17
- 2.22.2 — 2023-09-27
- 2.22.1 — 2023-09-25
- 2.22.0 — 2023-09-25
- 2.21.1 — 2023-09-09
- 2.21.0 — 2023-09-09
- 2.20.1 — 2023-01-17
- 2.20.0 — 2022-12-29
- 2.19.0 — 2022-12-23
- … 35 more at https://npm.io/package/tily/versions

## README

# tily

> Fast, small and purely functional utility library.
>
> [API Document](https://betaly.github.io/tily/)

## Install

```
$ npm install tily
```

## Features

- [Fast](#benchmarks)
- [Small](#bundle-size)
- [Fully tested](https://coveralls.io/github/betaly/tily)
- [Documented](https://betaly.github.io/tily/)
- Purely functional
- Modern codebase

## Structure of the library

- [`/object`](https://github.com/betaly/tily/tree/master/src/object) – for objects
- [`/string`](https://github.com/betaly/tily/tree/master/src/string) – for strings
- [`/promise`](https://github.com/betaly/tily/tree/master/src/promise) – for promises
- [`/array`](https://github.com/betaly/tily/tree/master/src/array) – for arrays or array-like objects
- [`/function`](https://github.com/betaly/tily/tree/master/src/function) – for functions – composition, currying and so
  on, also a set of simple functions (noop, T, F)
- [`/is`](https://github.com/betaly/tily/tree/master/src/is) – set of type checking methods
- [`/`](https://github.com/betaly/tily/tree/master/src) – root contains utilities which don't satisfy any of the above
  categories or are universal

## Usage

```js
import pathOr from 'tily/object/pathOr';
import compose from 'tily/function/compose';
import toLower from 'tily/string/toLower';
import map from 'tily/array/map';

const toLowerName = compose(toLower, pathOr(['name'], ''));
const result = map(toLowerName)([{name: 'testA'}, {name: 'testb'}]);
```

## Benchmarks

```bash
$ npm run benchmark
```

| Utility       | Lodash             | Ramda             | Tily              |
| ------------- | ------------------ | ----------------- | ----------------- |
| clone         | 120,807 ops/sec    | 112,053 ops/sec   | 293,572 ops/sec   |
| array/filter  | 2,080,728 ops/sec  | 1,849,633 ops/sec | 2,046,113 ops/sec |
| is/empty      | 1,506,963 ops/sec  | 474,177 ops/sec   | 3,731,564 ops/sec |
| function/flip | 7,528,745 ops/sec  | 3,735,143 ops/sec | 3,490,207 ops/sec |
| object/path   | 12,023,128 ops/sec | 8,894,639 ops/sec | 7,587,076 ops/sec |
| string/trim   | 4,215,928 ops/sec  | 1,034,655 ops/sec | 6,029,794 ops/sec |

## Browser support

- Chrome >= 40
- Firefox >= 52
- Edge >= 14
- IE >= 11
- Safari >= 10
- iOS >= 10
- Android >= 4.4

## Node support

- 6.4.0 and higher

## Bundle size

| Library                         | Bundle size |
| ------------------------------- | ----------- |
| import \_ from 'lodash'         | 70.1 kb     |
| import ... from 'lodash/...'    | 21.8 kb     |
| import R from 'ramda'           | 41.3 kb     |
| import ... from 'ramda/src/...' | 10 kb       |
| import ... from 'tily/...'      | 2.32 kb     |

For detailed comparison with specific libraries see [COMPARE.md](https://github.com/betaly/tily/tree/master/COMPARE.md)

---
_Source: https://npm.io/package/tily · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
