Returns an array of property names exposed from a glob of javascript modules. Useful for linting, documentation, table of contents, etc.
Install with npm:
$ npm install glob-keys --save
var globKeys = require('glob-keys');
Given the following files exist:
// --foo.js--
exports.foo = function(){}
// --bar.js--
exports.bar = function(){}
// --baz.js--
exports.baz = function(){}
exports.qux = function(){}
exports.fez = function(){}
// --obj.js--
exports.abc = {};
exports.xyz = '123';
The following would return an array of keys exposed on all of the listed files:
var keys = globKeys(['*.js']);
//=> ['bar', 'baz', 'qux', 'fez', 'foo', 'abx', 'xyz']
You might also be interested in these projects:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v, on March 25, 2016.