# autonomy

> Lightweight functional utility library complementing ES6

Latest version **2.1.0** (published 2016-01-28) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2016-01-28 |
| First published | 2012-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Eirik Albrigtsen |
| Maintainers | clux |
| Keywords | utility, functional, haskell, curry, zipWith, FP, ES6 |

## Links

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

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2016-01-28
- 2.0.0 — 2016-01-27
- 1.0.1 — 2015-11-14
- 1.0.0 — 2014-09-30
- 0.5.2 — 2014-09-02
- 0.5.1 — 2014-07-10
- 0.5.0 — 2012-11-11
- 0.4.2 — 2012-10-20
- 0.4.1 — 2012-10-20
- 0.4.0 — 2012-10-20
- 0.3.0 — 2012-07-04
- 0.2.0 — 2012-06-30
- 0.1.0 — 2012-06-17

## README

# Autonomy
[![npm status](http://img.shields.io/npm/v/autonomy.svg)](https://www.npmjs.org/package/autonomy)
[![build status](https://secure.travis-ci.org/clux/autonomy.svg)](http://travis-ci.org/clux/autonomy)
[![dependency status](https://david-dm.org/clux/autonomy.svg)](https://david-dm.org/clux/autonomy)
[![coverage status](http://img.shields.io/coveralls/clux/autonomy.svg)](https://coveralls.io/r/clux/autonomy)

Autonomy is a lightweight functional helper library. It is meant to complement an ES6 style with curried helpers, math helpers, curried accessors and higher order looping constructs.

These library is partly inspired by Haskell's [Prelude](https://hackage.haskell.org/package/base/docs/Prelude.html).

## Usage
Use it with qualified imports with the yet unfinished module `import` syntax or attach it to the short variable of choice. For selling points, here's how it will look with ES7 modules.

```js
import { not, any, gcd, elem, even, range, replicate, zip3, zipWith2, reduce } from 'autonomy'

var partition = (p, xs) => [xs.filter(p), xs.filter(not(p))];
partition((x) => x > 5, [8,3,4,5,6]); // [ [ 8, 6 ], [ 3, 4, 5 ] ]

[[3,4,5], [4,5,6]].filter(any(elem([6, 7]))); // [ [ 4, 5, 6 ] ]

range(10).filter(even); // [ 2, 4, 6, 8, 10 ]

replicate(5).forEach(cluster.fork); // calls a function with undefined arguments

zip3(range(5), [1,2], [3,2,5]); // [ [ 1, 1, 3 ], [ 2, 2, 2 ] ]
zipWith2(gcd, [5, 10, 15], range(5)); // [ 1, 2, 3 ]

var product = reduce((x, y) => x * y, 1);
var factorial = (n) => product(range(n));
factorial(4); // 24
```

Read the read the [API](https://github.com/clux/autonomy/blob/master/api.md).

This modules makes up the core part of the larger utility library [interlude](https://github.com/clux/interlude).

## Installation

```sh
$ npm install autonomy
```

## License
MIT-Licensed. See LICENSE file for details.

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