Skip to content

Latest commit

 

History

History
110 lines (64 loc) · 3.82 KB

real-world-samples.md

File metadata and controls

110 lines (64 loc) · 3.82 KB

Real world projects. Dependency cruised.

Some popular projects on npm

Commander

tj/commander.js - For command line parsing - and cooking command line interfaces.

commander

Chalk

chalk/chalk - For coloring strings in the terminal. A typical Sorhus style micro module that uses other micro modules to accomplish its goals.

chalk

Bluebird

petkaantonov/bluebird - promise library

bluebird

Safe-regex

substack/safe-regex - for sanity checking regular expressions against exponential time errors. For everyone who enables users to input regular expressions in.

safe-regex

Resolve

substack/node-resolve - resolves (node) module names to files on disk.

resolve

Yargs

yargs/yargs - Another library to parse command line options/ cook command line interfaces.

yargs

Typescript

It is possible to use dependency-cruiser to infer dependencies of typescript projects.

We got the picture of tslint by running this in its source folder:

dependency-cruise -T dot -x node_modules -v -- src/index.ts  | dot -T png > tslint-without-node_modules.png

(Yep, that's all - no separate transpilation steps necessary ...)

tslint

palantir/tslint - linter for typescript.

The orange lines are warnings for circular dependencies, which occur around two of tslint's 'barrel' index.ts modules:

tslint

CoffeeScript

In the same vein dependency-cruiser directly supports CoffeeScript.

In the src folder of the coffeescript repo run this:

depcruise -x node_modules -T dot . | dot -T png > coffee-script-coffee-without-node_modules.png

coffeescript

jashkenas/coffeescript - the coffeescript transpiler:

coffee-script

(You see one module flagged as unresolvable - this is the parser code that the coffeescript build script generates jison into the folder with transpiled javascript.)

My own projects

dependency cruiser

Dependency cruiser used on itself. node_modules left out to keep it concise. A small custom theme in its configuration colors the various main parts (extract, validate, report) and the dependencies to them. Click for a slightly more interactive version.

dependency cruiser's dependency graph

state machine cat

sverweij/state-machine-cat - an interpreter for writing nice state diagrams. Click for a slightly more interactive version.

state-machine-cat without external dependencies

mscgen.js

mscgenjs/mscgenjs-core - an interpreter library for turning text (in MscGen or two other DSLs) into sequence charts. Click for a slightly more interactive version.

mscgen.js