yarn-logical-tree
This package is a wrapper to getnpm-logical-tree
working with a yarn.lock
file - most code and tests are taken from that package. The API is the same except for address
(and consequently path
) which is not implemented (if you need path
/ address
- issues/PRs are very much welcome!)
Install
npm install yarn-logical-tree
/
yarn add yarn-logical-tree
Example
const fs = const lockfile = const yarnLogicalTree = const packagePath = '/path/to/package'const pkg = fsconst yarnLock = fs const yarnLockParsed = lockfileconst pkgParsed = JSON // returns:LogicalTree name: 'some-package' version: '1.0.0' address: null optional: false dev: false bundled: false resolved: undefined integrity: undefined requiredBy: Set dependencies: Map 'foo' LogicalTree name: 'foo' version: '1.2.3' address: 'foo' optional: false dev: true bundled: false resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz' integrity: 'sha1-rYUK/p261/SXByi0suR/7Rw4chw=' dependencies: Map ... requiredBy: Set ... ...
License
MIT