1.0.0 • Published 9 years ago

my-funcs v1.0.0

Weekly downloads
4
License
-
Repository
-
Last release
9 years ago

my-funcs Travis branch Coverage Status

Get a list of all of the named functions you defined in your project

NOTE: This depends on deep-ast which uses synchronous I/O and should not be used at request time.

API

myFuncs : (filename: String) => (() => Array<String>|Error)

my-funcs exposes one function which takes a filename. the file is loaded and then a deep-ast is generated based on the file. The AST is then traversed and each named function is found and returned.

Install

npm install --save my-funcs

Example

Running on it's own source, my-funcs will generate a list of functions:

var myFuncs = require('myFuncs');
console.log(myFuncs('./index.js'));

// ['myFuncs', 'getNames', 'findFunctions', 'findFunction', 'getFunctionNameFromNode']