npm.io
1.2.0 • Published 9 years ago

fn-annotate

Licence
MIT
Version
1.2.0
Deps
0
Vulns
0
Weekly
0
Stars
4

fn-annotate

NPM Version Build Status NPM Downloads License

Get the argument names of a JavaScript function.

Install

npm install --save fn-annotate

Usage

var annotate = require('fn-annotate');

function myFunction (user, document, db) {
  // do some stuff.
}

var argumentNames = annotate(myFunction);

// [ 'user', 'document', 'db' ]
console.log(argumentNames);

// [ 'x' ]
console.log(annotate(x => x));

// [ 'param' ]
console.log(annotate(function * (param) {}));

Keywords