Socket
Book a DemoInstallSign in
Socket

octopus-modules

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octopus-modules

Multi-module repo graph handler

latest
Source
npmnpm
Version
0.0.12
Version published
Maintainers
1
Created
Source

octopus-modules npm

Library that exports functions thar emit/operate on npm multi-module repos.

Install

npm install --save octopus-modules

API

modules(): [module]

Resolves all modules in a multi-npm-module npm repo with rules:

  • modules are discovered recursively;
  • modules marked as private (private: true in package.json) are traversed into and treated as aggregate modules, but not added in list;

Returns a topologically sorted array of modules with where array item is an object with properties:

  • name: module name;
  • version: module version;
  • path: absolute module path;
  • relativePath: path relative to root of repo;
  • dependencies: array of modules that this module depends on in same repo. Obects with properties:
    • name: module name;
    • path: absolute module path;
    • relativePath: path relative to root of repo;

removeNotInPaths(modules, paths): modules

Removes modules who does not have matching entries in paths array. Example is if you have list of changed files and you pass it, only modules and dependees will be left in tree.

removeUnchanged(modules, label = 'default'): modules

Removed modules form provided list that have no changes in fs for given label.

markBuilt(label = 'default')(module)

Marks module as built with given label.

markUnbuilt(label = 'default')(module)

Marks module as unbuilt for given label.

FAQs

Package last updated on 27 Jun 2017

Did you know?

Socket

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