0.1.1 • Published 8 years ago

glob-keys v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

glob-keys NPM version NPM downloads Build Status

Returns an array of property names exposed from a glob of javascript modules. Useful for linting, documentation, table of contents, etc.

Install

Install with npm:

$ npm install glob-keys --save

Usage

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']

Related projects

You might also be interested in these projects:

  • matched: Adds array support to node-glob, sync and async. Also supports tilde expansion (user home) and… more | homepage
  • method-names: Returns an array of names from a module. Includes all enumerable properties with function values,… more | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v, on March 25, 2016.