fn-args
TypeScript icon, indicating that this package has built-in type declarations

6.0.0 • Public • Published

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

Package Sidebar

Install

npm i fn-args

Weekly Downloads

227,308

Version

6.0.0

License

MIT

Unpacked Size

5.55 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus