Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Pull your modular project into memory so you can get fancy with it
JavaScript Makefile

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
example
test
transforms
.gitignore
History.md
License
Makefile
Readme.md
file.js
index.js
package.json

Readme.md

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'
  ]
}
Something went wrong with that request. Please try again.