Giter VIP home page Giter VIP logo

node-shrinked's Introduction

shrinked NPM version Build Status Dependency Status

Parses the shrinkwrap.json and returns the B+ tree of the dependencies.

<name>: {
  <version>: {
    dependencies: {
      <dep-name>: {
        <dep-range>: <dep-version>
      }
    },
    
    asyncDependencies: ...,
    devDependencies: ...
  }
}

Install

$ npm install shrinked --save

Usage

var shrinked = require('shrinked');

shrinked(file, [options], callback)

  • file path Absolute path of the xxx-shrinkwrap.json
  • callback function(err, tree)
  • err Error
  • tree Object the B+ tree of dependencies which described above.
  • options Object
    • dependencyKeys Array=['dependencies'] into which dependency key should shrinked decende down.
shrinked('cortex-shrinkwrap.json', {
  dependencyKeys: [
    'dependencies',
    // Then `shrinked` will parse three more keys in addition.
    'asyncDependencies',
    'devDependencies',
    'engines'
  ]
}, function(err, tree){
  if (err) {
    return console.error(err);
  }
  console.log('The B+ tree is', util.inspect(tree, depth: 10));
});

shrinked.parse(json, [options])

  • json Object the object of shrinkwrap.json

Returns tree

License

MIT

node-shrinked's People

Stargazers

Andrew Hutchings avatar

Watchers

Kael avatar James Cloos avatar  avatar

node-shrinked's Issues

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.