pkgs-graph
TypeScript icon, indicating that this package has built-in type declarations

8.0.0 • Public • Published

pkgs-graph

Create a graph from an array of packages

npm version

Installation

pnpm add 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',
//      },
//    },
//  }

Related

License

MIT © Zoltan Kochan

Readme

Keywords

Package Sidebar

Install

npm i pkgs-graph

Weekly Downloads

4,045

Version

8.0.0

License

MIT

Unpacked Size

11.3 kB

Total Files

6

Last publish

Collaborators

  • zkochan
  • pnpmuser