Get unlimited public & private packages + team-based management with npm Teams.Learn more »

fn-args

5.0.0 • Public • Published

fn-args Build Status

Get the arguments of a function, arrow function, generator function, async function

Install

$ npm install fn-args

Usage

const functionArguments = require('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']

License

MIT © Sindre Sorhus

Install

npm i fn-args

DownloadsWeekly Downloads

63,333

Version

5.0.0

License

MIT

Unpacked Size

5.58 kB

Total Files

5

Last publish

Collaborators

  • avatar