# tiny-fns

> A microscopic zero-dep library of immutable helper functions that probably didn't need to be written.

Latest version **1.0.4** (published 2018-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-fns
pnpm add tiny-fns
yarn add tiny-fns
bun add tiny-fns
```

## 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 | 1.0.4 |
| Published | 2018-02-20 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shawn Erquhart |
| Maintainers | erquhart |
| Keywords | util |

## Links

- npm: https://www.npmjs.com/package/tiny-fns
- Repository: https://github.com/erquhart/tiny-fns
- Homepage: https://github.com/erquhart/tiny-fns#readme
- Issues: https://github.com/erquhart/tiny-fns/issues
- npm.io page: https://npm.io/package/tiny-fns

## 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

- 1.0.4 (latest) — 2018-02-20
- 1.0.3 — 2018-02-20
- 1.0.2 — 2018-02-20
- 1.0.0 — 2018-02-20

## README

# tiny-fns

A microscopic zero-dep library of immutable helper functions that probably didn't need to be written.

## usage

```bash
npm install tiny-fns
```

```js
import { flatten } from 'tiny-fns'

flatten([['a'], ['b']])
```

## docs

#### [**`chunk`**](https://github.com/erquhart/tiny-fns/blob/master/tiny-fns.js#L1-L13) ([try it](https://runkit.com/erquhart/tiny-fns-chunk))

Splits an array into multiple arrays of specified length.

```js
chunk(['a', 'b', 'c', 'd', 'e'], 2)

// -> [['a', 'b'], ['c', 'd'], ['e']]
```

#### [**`flatten`**](https://github.com/erquhart/tiny-fns/blob/master/tiny-fns.js#L15-L29) ([try it](https://runkit.com/erquhart/tiny-fns-flatten))

Flattens an array one level deep.

```js
flatten([['a', 'b'], ['c'], 'd', [['e']]])

// -> ['a', 'b', 'c', 'd', ['e']]
```

#### [**`fromPairs`**](https://github.com/erquhart/tiny-fns/blob/master/tiny-fns.js#L31-L42) ([try it](https://runkit.com/erquhart/tiny-fns-frompairs))

Creates an object from an array of key/value pair arrays.

```js
fromPairs([['a', 1], ['b', 2], ['c', 3]])

// -> { a: 1, b: 2, c: 3 }
```

#### [**`mapKeys`**](https://github.com/erquhart/tiny-fns/blob/master/tiny-fns.js#L44-L66) ([try it](https://runkit.com/erquhart/tiny-fns-mapkeys))

Creates a new object by mapping keys of an existing object.

```js
mapKeys({ a: 1, b: 2, c: 3 }, key => `${key}${key}`)

// -> { aa: 1, bb: 2, cc: 3 }
```

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