fn-args

v6.0.0
Get the arguments of a function, arrow function, generator function, async function
function arguments tostring extract parse generator async arrow

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 fn-args

Metadata

  • MIT
  • ^12.20.0 || ^14.13.1 || >=16.0.0
  • Sindre Sorhus
  • released 8/24/2021

Downloads

Maintainers