# invoke-fn

> A faster alternative to `Function#apply`.

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

## Install

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

## 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-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | invoke, execute, call, apply, function, exception, error |

## Links

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

## 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

## README

# invoke-fn

> A faster alternative to `Function#apply`.

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

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



## Install

```
$ npm install --save invoke-fn 
```



## Usage

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

```js

var invoke = require('invoke-fn');

// invoke(func, thisArg, args);

var obj = {
  add: function () {
    var result = 0;
    for (var i = 0, length = arguments.length; i < length; i++) {
      result += arguments[i]
    }
    return result;
  }
}
    
invoke(function (a, b, c, d) {
  return this.add(a, b, c, d);
}, obj, [1, 2, 3, 4]);

// => 10
```

## Related

- [invoke-fn](https://github.com/gearcase/invoke-fn) - A faster alternative to `Function#apply`.
- [invoke-before](https://github.com/gearcase/invoke-before) - Returns a function that will only be executed before being called N times.
- [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.
- [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-fn/issues/new).

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