Napoleon's Penguin Mascot
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

fn-annotate

1.2.0 • Public • Published

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) {}));

install

npm i fn-annotate

Downloadsweekly downloads

170

version

1.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar