fn-args

v3.0.0
Get the arguments of a function, arrow function, generator function, async function
function arguments fn func args tostring extract parse generator and 3 more...

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

Metadata

  • MIT
  • >=4
  • Sindre Sorhus
  • released 4/22/2017

Downloads

Maintainers