Grab all of the source files from a node.js package.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
README.markdown
index.js
package.json

README.markdown

source

Grab all of the source files from a package.

methods

modules

Returns an object with top-level names mapped to file contents.

The 'package.json' key is special in that it contains a JSON.parse()'d Object instead of a Buffer with the contents.

examples

traverse

var source = require('source')
console.dir(Object.keys(
    source.modules('traverse')
));

[ 'traverse', 'traverse/package.json' ]

jade

var source = require('source')
console.dir(Object.keys(
    source.modules('jade')
));

[ 'jade',
  'jade/package.json',
  'jade/lib/jade.js',
  'jade/lib/compiler.js',
  'jade/lib/utils.js',
  'jade/lib/self-closing.js',
  'jade/lib/index.js',
  'jade/lib/._parser.js',
  'jade/lib/lexer.js',
  'jade/lib/parser.js',
  'jade/lib/._doctypes.js',
  'jade/lib/._self-closing.js',
  'jade/lib/doctypes.js',
  'jade/lib/filters.js',
  'jade/lib/nodes/tag.js',
  'jade/lib/nodes/filter.js',
  'jade/lib/nodes/doctype.js',
  'jade/lib/nodes/code.js',
  'jade/lib/nodes/._each.js',
  'jade/lib/nodes/block.js',
  'jade/lib/nodes/index.js',
  'jade/lib/nodes/._block.js',
  'jade/lib/nodes/._code.js',
  'jade/lib/nodes/._text.js',
  'jade/lib/nodes/comment.js',
  'jade/lib/nodes/text.js',
  'jade/lib/nodes/each.js',
  'jade/lib/nodes/node.js',
  'jade/lib/._filters.js',
  'jade/lib/._jade.js',
  'jade/._index' ]