# @rgrannell/chain

> Builder-pattern utility

Latest version **9.4.0** (published 2020-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rgrannell/chain
pnpm add @rgrannell/chain
yarn add @rgrannell/chain
bun add @rgrannell/chain
```

## 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 | 9.4.0 |
| Published | 2020-07-08 |
| First published | 2018-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rgrannell |

## Links

- npm: https://www.npmjs.com/package/@rgrannell/chain
- npm.io page: https://npm.io/package/@rgrannell/chain

## Dependencies (1)

- [chai](https://npm.io/package/chai.md) ^4.1.2

## Recent versions

- 9.4.0 (latest) — 2020-07-08
- 8.1.0-alpha.49d6f21a (canary) — 2018-08-02
- 9.3.0 — 2020-07-08
- 9.2.0 — 2020-07-07
- 9.1.0 — 2019-10-01
- 9.0.0 — 2019-09-01
- 8.4.0 — 2019-08-11
- 8.2.0 — 2018-08-06
- 8.1.0 — 2018-08-04
- 8.1.0-alpha.99dad58c — 2018-07-27
- 8.1.0-alpha.278140ed — 2018-07-26
- 8.1.0-alpha.e979564a — 2018-07-19
- 8.1.0-alpha.d4bb12f7 — 2018-07-16
- 8.1.0-alpha.ded934b0 — 2018-07-16
- 8.1.0-alpha.849b3614 — 2018-07-16
- … 10 more at https://npm.io/package/@rgrannell/chain/versions

## README

# chain (v9.3.0)

## Stability

> 0 - Experimental

Builder-pattern utility



## Table of Contents

- [chain](#chain)
  * [Parameters](#parameters)

## API Documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## chain

Create a builder-pattern function

### Parameters

-   `methods` **[Object][1]** An object of functions, with the property being the method-name, the
                               value being the method to call. A state object is bound to the methods first parameter.
-   `state` **[Object][1]** A state object (optional, default `{}`)

Returns **[Proxy][2]** A proxy that intercepts the method name & dispatches the correct function.

[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy


## Dependencies

- Node.js >= v10.6.0
- NPM >= v10.6.0

## License

Copyright (c) 2020 Róisín Grannell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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