$ npm install get-params
Get a list of function's argument variable names (parameters).
$ npm install --save get-params
var getParams = require('get-params');
var myFunction = function (one, two, three) {
return 'blah';
};
var params = getParams(myFunction);
console.log(params); // ['one', 'two', 'three']
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);
MIT © Fahad Ibnay Heylaal
© 2010 - cnpmjs.org x YWFE | Home | YWFE