# invoke-before

> Returns a function that will only be executed before being called N times.

Latest version **1.0.0** (published 2016-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install invoke-before
pnpm add invoke-before
yarn add invoke-before
bun add invoke-before
```

## 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.0 |
| Published | 2016-04-15 |
| First published | 2016-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | invoke, once, before, after, execute, call, apply, function, exception, error |

## Links

- npm: https://www.npmjs.com/package/invoke-before
- Repository: https://github.com/gearcase/invoke-before
- Homepage: https://github.com/gearcase/invoke-before#readme
- Issues: https://github.com/gearcase/invoke-before/issues
- npm.io page: https://npm.io/package/invoke-before

## Dependencies (2)

- [invoke-fn](https://npm.io/package/invoke-fn.md) ^1.0.0
- [to-integer](https://npm.io/package/to-integer.md) ^1.0.1

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-15
- 0.0.0 — 2016-04-12

## README

# invoke-before

> Returns a function that will only be executed before being called N times.

[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/invoke-before/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/gearcase/invoke-before/master.svg?style=flat-square)](https://travis-ci.org/gearcase/invoke-before)
[![coverage:?](https://img.shields.io/coveralls/gearcase/invoke-before/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/invoke-before)


## Install

```
$ npm install --save invoke-before 
```

## Usage

> For more use-cases see the [tests](https://github.com/gearcase/invoke-before/blob/master/test/spec/index.js)

```js

var invokeBefore = require('invoke-before');

// invokeBefore(n, func);

invokeBefore(1, func); // never be executed
invokeBefore(2, func); // only be executed once
invokeBefore(3, func); // only be executed twice

// ...
```

## Related

- [invoke-after](https://github.com/gearcase/invoke-after) - Returns a function that will only be executed after being called N times.
- [invoke-once](https://github.com/gearcase/invoke-once) - Restrict the given function only be invoked once.
- [invoke-fn](https://github.com/gearcase/invoke-fn) - A faster alternative to `Function#apply`.
- [try-invoke](https://github.com/gearcase/try-invoke) - Attempts to invoke the given function, returning either the result or the caught error object.
- [is-native](https://github.com/gearcase/is-native) - Checks if the given value is a native function.
- [to-source-code](https://github.com/gearcase/to-source-code.git) - Converts function to its source code.


## Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/gearcase/invoke-before/issues/new).

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