introspect-fun
Node module that enables the introspection of a function to return its parameters' name in an array.
Installation
npm install --save introspect-fun
API
Basic usge
var introspect = ;var {};var {}; {}; { {}}; var res1 = ;// res1 = [] var res2 = ;// res2 = ['arg1', 'arg2', 'hello'] var res3 = ;// res3 = ['arg1', 'arg2', 'arg3'] var res4 = ;// res4 = ['arg1'] var res5 = ;// res5 = ['notNestedArg']
ES6 Generator functions an arrow functions
Generator functions and arrow functions won't be a problem under --harmony
flag
var introspect = ; var {}; var resGen = ;// resGen = ['arg1', 'arg2'] var resArrow = ;// resArrow = ['arg1']
Motivation
Inspired from
- Jack Allan's answer on stackoverflow
- Killianc's node module : node-introspect
Run test
npm test