Skip to content
Get list of all dependencies from xxx-shrinkwrap.json
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE-MIT
Makefile
README.md
index.js
package.json

README.md

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

Something went wrong with that request. Please try again.