@pnpm/workspace.pkgs-graph
v4.0.7
Published
Create a graph from an array of packages
Downloads
373,474
Readme
@pnpm/workspace.pkgs-graph
Create a graph from an array of packages
Installation
pnpm add @pnpm/workspace.pkgs-graph
Usage
import createPkgsGraph from 'pkgs-graph'
const {graph} = createPkgsGraph([
{
dir: '/home/zkochan/src/foo',
manifest: {
name: 'foo',
version: '1.0.0',
dependencies: {
bar: '^1.0.0',
},
},
},
{
dir: '/home/zkochan/src/bar',
manifest: {
name: 'bar',
version: '1.1.0',
},
}
])
console.log(graph)
//> {
// '/home/zkochan/src/foo': {
// dependencies: ['/home/zkochan/src/bar'],
// manifest: {
// name: 'foo',
// version: '1.0.0',
// dependencies: {
// bar: '^1.0.0',
// },
// },
// },
// '/home/zkochan/src/bar': {
// dependencies: [],
// manifest: {
// name: 'bar',
// version: '1.1.0',
// },
// },
// }