# @tinkoff/utils

> Fast, small and purely functional utility library

Latest version **2.6.2** (published 2023-08-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @tinkoff/utils
pnpm add @tinkoff/utils
yarn add @tinkoff/utils
bun add @tinkoff/utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.6.2 |
| Published | 2023-08-02 |
| First published | 2018-06-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 283.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 177 |
| Author | Tinkoff team |
| Maintainers | hondasmx, makar_l, tinkoffbank, tom910, dmitry-korolev, rouland, ishivan, ytsareva, shoom3301, waterplea, meskill, marsibarsi, zig-green, defenderbass, super_oleg, dersizes, alexkvak |
| Keywords | tinkoff, utils, ramda, lodash, curry, performance |

## Links

- npm: https://www.npmjs.com/package/@tinkoff/utils
- Repository: https://github.com/Tinkoff/utils.js
- Homepage: https://github.com/Tinkoff/utils.js#readme
- Issues: https://github.com/Tinkoff/utils.js/issues
- npm.io page: https://npm.io/package/@tinkoff/utils

## 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.6.2 (latest) — 2023-08-02
- 2.0.0-alpha.6 (alpha) — 2019-03-22
- 2.6.1 — 2023-08-01
- 2.5.6 — 2023-08-01
- 2.5.5 — 2023-07-31
- 2.5.4 — 2023-07-31
- 2.5.3 — 2023-07-31
- 2.5.2 — 2023-07-31
- 2.5.1 — 2023-07-31
- 2.6.0 — 2023-07-31
- 2.5.0 — 2023-06-19
- 2.4.0 — 2023-05-15
- 2.3.2 — 2023-01-28
- 2.3.1 — 2023-01-11
- 0.6.2 — 2022-10-21
- … 18 more at https://npm.io/package/@tinkoff/utils/versions

## README

# Tinkoff Utils [![Build status](https://img.shields.io/github/actions/workflow/status/Tinkoff/utils.js/build.yml?branch=master)](https://img.shields.io/github/actions/workflow/status/Tinkoff/utils.js/build.yml?branch=master) [![Coverage Status](https://coveralls.io/repos/github/Tinkoff/utils.js/badge.svg?branch=master&t=CdowK8)](https://coveralls.io/github/Tinkoff/utils.js?branch=master)

> Fast, small and purely functional utility library

## Install
```
$ npm install @tinkoff/utils
```

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

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

## Usage
```js
import pathOr from '@tinkoff/utils/object/pathOr';
import compose from '@tinkoff/utils/function/compose';
import toLower from '@tinkoff/utils/string/toLower';
import map from '@tinkoff/utils/array/map'

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

## Benchmarks
```bash
$ npm run benchmark
```

| Utility | Lodash | Ramda | Utils |
| --- | --- | --- | --- |
| 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 '@tinkoff/utils/...' | 2.32 kb |

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

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