sourcegraph

Sourcegraph takes an entry file and walks its dependency graph recursively to produce a graph data structure. This should make it easy to introspect your project or compile production builds etc..

npm install sourcegraph
2 downloads in the last week
110 downloads in the last month

sourcegraph

Sourcegraph takes an entry file and walks its dependency graph recursively to produce a graph data structure. This should make it easy to introspect your project or compile production builds etc..

Its similar to module-deps and is even API compatable in a lot of ways but doesn't limit itself by trying hopelessly to stream everything.

Installation

$ npm install sourcegraph [--global]

API

var graph = require('sourcegraph')

graph(entry)

takes an entry path and returns an Array of file objects

graph(__dirname + '/index.js')

CLI

$ sourcegraph index.js

Data format

each file objects looks like this:

{
  id: "/full/path/to/index.js",
  source: 'the files source transpiled to JS according to its packages specification',
  deps: {
    "./dep1": "/full/path/to/dep1.js",
    "dep2": "/full/path/to/node_modules/dep2"
  },
  aliases: [
    '/any/relavant/symlinks/pointing/to/this/file'
  ]
}
npm loves you