Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

get-params

fahad19402.7kMIT0.1.2TypeScript support: definitely-typed

Get a list of function's argument variable names

functions, function, params, parameters, get, parse, variables, reflect, reflection

readme

get-params

Build Status

Get a list of function's argument variable names (parameters).

Install

$ npm install --save get-params

Usage

var getParams = require('get-params');

var myFunction = function (one, two, three) {
    return 'blah';
};

var params = getParams(myFunction);
console.log(params); // ['one', 'two', 'three']

Browser

You can also run it in the browser. Install it with bower:

$ bower install --save get-params

Include the script in your HTML:

<script src="./bower_components/get-params/index.js"></script>

The library will be available in window.GetParams:

var params = GetParams(myFunction);

License

MIT © Fahad Ibnay Heylaal