@pnpm/workspace.pkgs-graph
v1000.0.1
Published
Create a graph from an array of packages
Downloads
314,674
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',
// },
// },
// }