# chain-able

> interfaces that describe their intentions.

Latest version **4.0.6** (published 2017-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install chain-able
pnpm add chain-able
yarn add chain-able
bun add chain-able
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.6 |
| Published | 2017-06-30 |
| First published | 2017-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | James |
| Maintainers | aretecode |
| Keywords | chains, chaining, chain-able, chainable, conditional, expressive, fluent, chain, flipchain, fliphub-chain, fusebox-chain, webpack, fuse-box |

## Links

- npm: https://www.npmjs.com/package/chain-able
- Repository: https://github.com/fluents/chain-able
- Homepage: https://github.com/fluents/chain-able#readme
- Issues: https://github.com/fluents/chain-able/issues
- npm.io page: https://npm.io/package/chain-able

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 4.0.6 (latest) — 2017-06-30
- 5.0.0-beta.4 (beta) — 2017-07-21
- 4.0.0-beta.2 (beta.2) — 2017-06-29
- 4.0.0-beta.1 (beta.1) — 2017-06-26
- 2.0.2 (dot) — 2017-06-02
- 5.0.0-beta.3 — 2017-07-20
- 5.0.0 — 2017-07-18
- 4.0.5 — 2017-06-30
- 4.0.4 — 2017-06-30
- 4.0.3 — 2017-06-30
- 4.0.2 — 2017-06-30
- 4.0.1 — 2017-06-30
- 4.0.0 — 2017-06-30
- 4.0.0-beta.3 — 2017-06-30
- 3.0.0 — 2017-06-12
- … 5 more at https://npm.io/package/chain-able/versions

## README

# ⛓ chain-able

[![NPM version][chain-able-npm-image]][chain-able-npm-url]
[![docs](https://img.shields.io/badge/📖-docs-blue.svg)](https://github.com/fluents/chain-able/wiki)
[![Dependencies][david-deps-img]][david-deps-url]
[![fliphub][gitter-badge]][gitter-url]
[![BuildStatus](https://travis-ci.org/fluents/awesome-fluents.svg?branch=master)](https://travis-ci.org/fluents/awesome-fluents)
[![Coverage Status](https://coveralls.io/repos/github/fluents/chain-able/badge.svg?branch=master)](https://coveralls.io/github/fluents/chain-able?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b1d92a30c4aa43df9a6233cfadde2307)](https://www.codacy.com/app/aretecode/chain-able?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fluents/chain-able&amp;utm_campaign=Badge_Grade)
[![gzip size](http://img.badgesize.io/https://unpkg.com/chain-able@3.0.0/index.amd.js?compression=gzip)](https://unpkg.com/chain-able@3.0.0)
[![fluent](https://img.shields.io/badge/⛓-fluent-9659F7.svg)](https://github.com/fluents/awesome-fluents)
[![fluent](https://img.shields.io/badge/🎡-playground-black.svg)](https://aretecode.github.io/chain-able-playground/)


<!-- https://david-dm.org/fluents/chain-able.svg -->
[david-deps-img]: https://img.shields.io/badge/0-dependencies-blue.svg
[david-deps-url]: https://david-dm.org/fluents/chain-able
[chain-able-npm-image]: https://img.shields.io/npm/v/chain-able.svg
[chain-able-npm-url]: https://npmjs.org/package/chain-able
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: https://spdx.org/licenses/MIT
[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg
[gitter-url]: https://gitter.im/fliphub/Lobby

[wiki]: https://github.com/fluents/chain-able/wiki
[deps]: https://github.com/fluents/chain-able/wiki/deps
[parent]: https://github.com/fluents/chain-able/wiki/parent
[analogy]: https://github.com/fluents/chain-able/wiki/analogy
[Observe]: https://github.com/fluents/chain-able/wiki/Observe
[DotProp]: https://github.com/fluents/chain-able/wiki/DotProp
[Schema]: https://github.com/fluents/chain-able/wiki/Schema
[Transform]: https://github.com/fluents/chain-able/wiki/Transform
[Shorthand]: https://github.com/fluents/chain-able/wiki/Shorthand
[API]: https://github.com/fluents/chain-able/wiki/api
[compose]: https://github.com/fluents/chain-able/wiki/Compose
[Chainable]: https://github.com/fluents/chain-able/wiki/Chainable
[ChainedMap]: https://github.com/fluents/chain-able/wiki/ChainedMap
[ChainedSet]: https://github.com/fluents/chain-able/wiki/ChainedSet
[FactoryChain]: https://github.com/fluents/chain-able/wiki/FactoryChain
[MergeChain]: https://github.com/fluents/chain-able/wiki/MergeChain
[MethodChain]: https://github.com/fluents/chain-able/wiki/MethodChain
[TraverseChain]: https://github.com/fluents/chain-able/wiki/TraverseChain
[CHANGELOG]: https://github.com/fluents/chain-able/blob/master/docs/CHANGELOG.md
[Snippet]: https://github.com/fluents/chain-able/wiki/Snippet
[Examples]: https://github.com/fluents/chain-able/wiki/Examples
[ExamplesPrimitives]: https://github.com/fluents/chain-able/wiki/Primitives
[ExamplesLocalStorage]: https://github.com/fluents/chain-able/wiki/LocalStorage
[ExamplesExpressive]: https://github.com/fluents/chain-able/wiki/LocalStorage
[ExamplesComparison]: https://github.com/fluents/chain-able/wiki/Comparison
[ExamplesIteratable]: https://github.com/fluents/chain-able/wiki/Iteratable
[TypeDefs]: https://github.com/fluents/chain-able/tree/master/typings
[Tests]: https://github.com/fluents/chain-able/tree/master/test
[Src]: https://github.com/fluents/chain-able/tree/master/src
[map]: https://ponyfoo.com/articles/es6-maps-in-depth
[set]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Set
[cov]: https://coveralls.io/github/fluents/chain-able?branch=master

> interfaces that describe their intentions


### 📦 install

```bash
yarn add chain-able
npm i chain-able --save
```

# 🏰 benefits

writing an api using chain-able means:
- write **1** api
- get **3** apis as a result!
  - 🍉 persistable, rehydratable, & transferrable configurations
  - ⛓ fluent/chainable api
  - 🍦 vanilla object syntax

# 🎁 features

- [expressive, clearly communicative code][wiki]
- [runtime type validation][Schema]
- [🔬 230+ tests][Tests] with [96%+ code coverage][cov]
- ⚡ [performant & tiny][Src] `~7kb` _(gzip)_ [_300 byte_ minimal version available as snippet][snippet]

<details><summary><em><b>more...</b></em></summary>

- [🌐 api][API]
  - [⛓ Chainable][Chainable]
  - [🗺 ChainedMap][ChainedMap]
  - [🔢 ChainedSet][ChainedSet]
  - [🍴 extends Map & Set, same transparent api][map]
  - [🔣 symbols to make usage even easier][Chainable]
- [🍭 iteratable][ExamplesIteratable]
- [🗣 expressive][ExamplesExpressive]
- [👾 makes solving complex problems simple][Examples]
- [💆 seamless native integration][ExamplesPrimitives]
- [🎼 compose & decorate][compose]
  - [👂 observe with Wildcard/Glob, RegExp, Functions][Observe]
  - [🤖 transform][Transform]
  - [🕵 debug][Shorthand]
  - [👣 traverse **any** data][TraverseChain]
  - [⚖️ fast deepEquals][Transform]
  - [🗺 remap][Transform]
  - [👆 tap][ChainedMap]
  - [🔋 toggleable dot.prop][DotProp]
  - [🖐 shorthands, wrap, return, setIfEmpty][Shorthand]
- [🛂 types, schemas, validation][Schema]
- [🔌 method builder][MethodChain]
  - [`onCall`][MethodChain]
  - [`onSet`][MethodChain]
  - [`onGet`][MethodChain]
  - [`type`][MethodChain]
  - [`define`][MethodChain]
  - [`getSet`][MethodChain]
  - [`default`][MethodChain]
  - [`initial`][MethodChain]
  - [`bind`][MethodChain]
  - [`camelCase`][MethodChain]
  - [`autoIncrement`][MethodChain]
  - [`factory`][MethodChain]
  - [`returns`][MethodChain]
  - [`callReturns`][MethodChain]
  - [`decorate (any object!)`][MethodChain]
- [🏭 infinitely nestable understandable factories][FactoryChain]
- [▶️◀️ easy deep merging][MergeChain]
- [☮️ compatibility - typescript, nodejs,  webpack, rollup, fusebox, babel, buble, amd][API]
- ⚡ performant & tiny `~7kb` _(gzip)_ [_300 byte_ minimal version available as snippet][snippet]

</details>

-----

### 🔗 related

- [😎⛓ awesome fluents](https://github.com/fluents/awesome-fluents)
- many thanks to [Eli Perelman](https://github.com/eliperelman) for all the chainable goodness
- thanks to [James Halliday](https://github.com/substack) for the tremendous [traversals](https://github.com/substack/js-traverse)
- thanks to [Sindre Sorhus](https://github.com/sindresorhus) for the simple [dot-prop](https://github.com/sindresorhus/dot-prop) access
- thanks to [Josh Duff](https://github.com/KyleAMathews) for [deep merging](https://github.com/KyleAMathews/deepmerge)
- based on [webpack-chain](https://github.com/mozilla-rpweb/webpack-chain), but not webpack-specific.
- thanks to [Jon Schlinkert](https://github.com/jonschlinkert/kind-of) & [inferno](https://github.com/infernojs/inferno/blob/master/packages/inferno-shared/src/index.ts) for type checking inspirations
- transpiled with [buble](https://gitlab.com/Rich-Harris/buble)
- [Martin Fowler on FluentInterface](https://www.martinfowler.com/bliki/FluentInterface.html)
<!-- - thanks to [ramda](https://github.com/ramda/ramda/tree/master/src/internal) & [lodash](https://github.com/lodash/lodash) for the currying -->

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