npm.io
6.0.0 • Published 5 years ago

fn-args

Licence
MIT
Version
6.0.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
53

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']

Keywords