Get parameter names for a given function (with ES6 arrow syntax support)
Install function-params
using npm:
npm install --save function-params
var functionParams = require('function-params');
functionParams(function (a, b, /* c */ d, e = 'f')); // ['a', 'b', 'd', 'e']
// Arrow functions:
functionParams(a => a); // ['a']
Name | Type | Description |
---|---|---|
fn | Function |
The function to get parameter names for |
Get parameter names from a function.
Name | Type | Description |
---|---|---|
str | String |
A stringified function to get parameter names for |
Get parameter names from a function string.
MIT