Socket
Socket
Sign inDemoInstall

monodeps

Package Overview
Dependencies
157
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    monodeps

simple tool to return list of cross dependant packages in a monorepo


Version published
Weekly downloads
7
Maintainers
1
Install size
11.5 MB
Created
Weekly downloads
 

Readme

Source

deps

Load dependency sorted array of package objects. Built to assist with publishing a monorepo containing multiple publishable modules were those modules may depend on another module defined in the monorepo. This is critical when attempting to lock in cross-dependencies with lock files. Unfortuantly a solution such as lerna does not work well with accurantly genating package lock files.

install

npm install monodeps

usage

const monodeps = require('monodeps')

/*
where folder example contains 3 packages: a,b,c.
c depends on b and a, b depends on a, a has no cross dependency.
*/
try{
  let packages = await deps.loadPackagesAsync("/example")

  console.log( packages[0].package.name ) // -> 'a'
  console.log( packages[1].package.name ) // -> 'b'
  console.log( packages[2].package.name ) // -> 'c'

  console.log( packages[0].path ) // -> /example/a
  console.log( packages[1].path ) // -> /example/b
  console.log( packages[2].path ) // -> /example/c

} catch(err){
  console.error(err) // -> "Error: circular dependency
}

Keywords

FAQs

Last updated on 09 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc