gen-graph

0.1.4 • Public • Published

gen-graph NPM version Build Status Dependency Status

Install

$ npm install gen-graph --save

Usage

var graph = require('gen-graph');
 
 
var conf = graph(shrinkwrap_json, options);
 
conf = graph(shrinkwrap);
 
conf = graph([shrinkwrap1, shrinkwrap2], {
  edge_keys:['dependencies', 'asyncDependencies', 'devDependencies']
});

Generated object will contains '_' property with the root tree's name and version.

var conf = graph({ name: "json", version: "1.0.0"});
 
// compressed conf will be
{
  0: [ 1.0.0" ],
  _: {
      "json@1.0.0": 0
  }
}
 
conf = graph({ name: "json", version: "1.0.0"}, { compress: false});
 
// uncompressed conf will be
{
  0: [ "json@1.0.0" ],
  _: {
      "json@1.0.0": 0
  }
}

So root node can be located fast.

Options

edge_keys {Array=}

Keys will be traveled as edges in graph, like 'devDependencies'. Default is ['dependencies', 'asyncDependencies']

compress {boolean=}

Whether output name in the graph node. Default is true.

Licence

MIT

Readme

Keywords

Package Sidebar

Install

npm i gen-graph

Weekly Downloads

1

Version

0.1.4

License

MIT

Last publish

Collaborators

  • kael
  • spud
  • villadora