# hook-factory

> pre and post hook factory

Latest version **1.0.0** (published 2018-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install hook-factory
pnpm add hook-factory
yarn add hook-factory
bun add hook-factory
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-12-11 |
| First published | 2018-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | azz0r |
| Maintainers | azz0r |

## Links

- npm: https://www.npmjs.com/package/hook-factory
- Repository: https://github.com/azz0r/hook-factory
- Homepage: https://github.com/azz0r/hook-factory#readme
- Issues: https://github.com/azz0r/hook-factory/issues
- npm.io page: https://npm.io/package/hook-factory

## Dependencies (1)

- [weighted](https://npm.io/package/weighted.md) ^0.3.0

## Recent versions

- 1.0.0 (latest) — 2018-12-11

## README

# 🏭 Hook Factory

## 📕 Index

- [Installing](#installing)
- [Usage](#usage)

### 💪 <a name="installing">Installing</a>

`yarn add hook-factor`

### 📒 <a name="usage">Usage</a>
```javascript

import Factory from "hook-factory";

const data = {
    count: 0
};

const modifier = ({
    prehook: data => {
        data.count++
        return data;
    },
    posthook: data => {
        data.count++
        return data;
    }
});

const modifiers = [modifier];

const newCount = factory({
    data,
    modifiers
});

console.log(newCount);
// { count: 2}
```

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