fn-args
v0.1.2 fn function args arguments tostring extract
fn-args
Get the arguments of a function, arrow function, generator function, async function
Install
$ npm install fn-args
Usage
import functionArguments from 'fn-args';
functionArguments(function (foo, bar) {});
//=> ['foo', 'bar']
functionArguments((foo, bar) => {});
//=> ['foo', 'bar']
functionArguments(function * (foo, bar) {});
//=> ['foo', 'bar']
functionArguments(async function (foo, bar) {});
//=> ['foo', 'bar']
npm i [email protected]
Metadata
- MIT
- >=0.10.0
- Sindre Sorhus
- released 3/17/2014