Giter Site home page Giter Site logo

hughsk / colony Goto Github PK

View Code? Open in Web Editor NEW
521.0 521.0 59.0 699 KB

:chart_with_upwards_trend: In-browser network graphs representing the links between your Node.js code and its dependencies.

Home Page: http://hughsk.github.com/colony

License: Other

JavaScript 94.00% CSS 5.83% Shell 0.17%

colony's Introduction

colony

In-browser graphs representing the links between your Node.js code and its dependencies.

Colony

Installation

$ [sudo] npm install -g colony

Quick Start

# Install colony and serve
$ [sudo] npm install -g serve colony
# Download and visualise "browserify" from NPM
$ colony --npm browserify && serve colony
# Open localhost:3000 in your web browser
$ open http://localhost:3000/

Using the Command-Line Interface

Usage: colony {files} --npm {modules}

Options:
  -o, --outdir   Output files to a particular folder                                     [default: "./colony"]
  -m, --modules  Traverse node_modules for more code. Use --no-modules to disable.       [default: true]
  -s, --scale    Scales the output graph by a specific size.                             [default: 1]
  -n, --npm      Download and process an NPM module instead of a local file.
  -t, --title    Change the title of the page
  -r, --readme   Readme file. By default will try to guess the first file's readme.
  -j, --json     Output the scripts' data as JSON, instead of generating and writing HTML
  -f, --fork     "Fork me on Github" button, e.g. "hughsk/colony". Hidden by default.
  -h, --help     Display this message

The simplest way to use colony from the command-line would be:

$ colony app.js -o colony

This will traverse app.js's dependencies and dump the necessary static HTML/CSS/JS files to the ./colony directory, this page being ./colony/index.html. Then it's just a matter of serving it up using something like serve, NGINX or plain old Apache.

For convenience, you can download and visualise any combination of NPM modules too:

$ colony --npm forever --npm component --npm browserify -o colony-npm

Development

Clone the repository from Github and install the development dependencies:

$ git clone git://github.com/hughsk/colony.git
$ cd colony
$ npm install

To rebuild/minify the client-side code, run npm run-script prepublish.

colony's People

Contributors

hughsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colony's Issues

json flag causes empty output

$ colony --npm browserify

creates a folder as it should,

$ colony --npm browserify --json

just outputs

{"nodes":[],"links":[],"scale":1}

without even reaching out to npm.

Error: Line 3: Unexpected reserved word

Getting this error while following instructions in the README:

❯ git clone https://github.com/trusktr/infamous
❯ cd infamous
❯ npm install
❯ npm run build-cjs
❯ colony ./index.js -o colony
/usr/local/lib/node_modules/colony/bin/colony:101
    if (err) throw err
             ^

Error: Line 3: Unexpected reserved word
    at throwError (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1151:21)
    at throwUnexpected (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1202:17)
    at parsePrimaryExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1577:16)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1669:48)
    at parsePostfixExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1710:20)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseUnaryExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1770:16)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseMultiplicativeExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1776:20)

JS is not copied to new colony directory

If I do:

$ npm install -g colony
...
$ cd my-project
$ colony index.js -o colony
path.existsSync is now called `fs.existsSync`.
Done!
$ ls -la colony
total 96
drwxr-xr-x   6 drewp  staff    204 Nov  7 19:50 .
drwxr-xr-x  21 drewp  staff    714 Nov  8 13:51 ..
drwxr-xr-x   4 drewp  staff    136 Nov  7 19:50 css
drwxr-xr-x   4 drewp  staff    136 Nov  7 19:50 files
drwxr-xr-x   5 drewp  staff    170 Nov  7 19:50 img
-rw-r--r--   1 drewp  staff  48288 Nov  7 19:50 index.html

For some reason, there is no js dir, meaning no compiled JS and thus the simulation/visualization fails.

Am I doing something wrong?

Support Destructuring assignment

/usr/local/lib/node_modules/colony/bin/colony:101
    if (err) throw err
             ^

Error: Line 2: Unexpected token {
    at throwError (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1151:21)
    at throwUnexpected (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1210:9)
    at parseVariableIdentifier (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:2081:13)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseVariableDeclaration (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:2091:18)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseVariableDeclarationList (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:2118:23)
    at parseConstLetDeclaration (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:2153:24)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseSourceElement (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3021:24)

index.js

require('app-module-path').addPath(__dirname);
const { app, sequelize } = require('./app');

Error: Cannot find module

Getting this error while following instructions in the README:

❯ colony --npm infamous && serve colony
colony-render@ /Users/trusktr/tmp/colony.tmp
└─┬ [email protected]
  └── [email protected]  (git://github.com/trusktr/famous.git#30160a17de6d35cce6f9b50f7eaac782159feabc)

module.js:341
    throw err;
    ^

Error: Cannot find module '/Users/trusktr/tmp/colony.tmp/node_modules/army-knife'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.require.resolve (internal/module.js:23:19)
    at /usr/local/lib/node_modules/colony/lib/index.js:111:28
    at Array.map (native)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/colony/lib/index.js:110:12)
    at ChildProcess.g (events.js:273:16)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)

Support for Typescript

Thought the visuals were very nice. Would like to be able to use it, especially with as interactive as it is. Support for Typescript should be added!

Unexpected token >

I've tried to run colony index.js -o colony but I receive the following error:

/usr/local/lib/node_modules/colony/bin/colony:101
    if (err) throw err
             ^

Error: Line 27: Unexpected token >
    at throwError (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1151:21)
    at throwUnexpected (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1210:9)
    at parsePrimaryExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1577:16)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1669:48)
    at parsePostfixExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1710:20)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseUnaryExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1770:16)
    at /usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:3295:38
    at parseMultiplicativeExpression (/usr/local/lib/node_modules/colony/node_modules/esprima/esprima.js:1776:20)

[Feature] Fuzzy finder for files

It would be really nice if there was a fuzzy finder option to quickly find the files you are looking for and highlight them, especially in large projects.

@sihrc

Project Maintenance

This looks a really cool and useful project. I'm wondering how's maintenance these days… From the long lived open issues it seems sort of abandoned. Do you need help finding maintainers?

Use template-literal instead of EJS

Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.

It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS 😀

can't see edges

running standard setup, this is what I see of the network :
selection_047

$ colony index.js -m && serve colony

seems like the connecting lines have a style which is opacity 0.3
not sure if there's a command i'm missing

love the package, great to use

Got trouble in WinXP

Hello,
your program looks very interesting, but i could not start it correctly

Trouble on WinXP sp3 (russian).
I was install colony thru npm.

npm install -g serve colony

Then start it.

D:\Temp>colony --npm browserify
CreateProcessW: ?? ??????? ????? ????????? ????.

C:\Documents and Settings\ilja\Application Data\npm\nod
ny:81
    if (err) throw err
                   ^
Error: NPM exited with code 127
    at ChildProcess.colony.npm (C:\Documents and Settin
npm\node_modules\colony\lib\index.js:104:41)
    at ChildProcess.g (events.js:185:14)
    at ChildProcess.EventEmitter.emit (events.js:91:17)
    at Process._handle.onexit (child_process.js:674:10)

Versions:

node --version
v0.8.2
npm -v
1.1.36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.