npm-link-extra
Some useful things we wish npm/yarn link had. Inspired by fs-extra...
One issue currently is the inconsistency between npm's link behavior between the major versions. We have found link to be most stable with version 3.10.10 so that is our recommended npm version.
Install
$ npm install npm-link-extra --save-dev
CLI Docs
Usage $ nlx <path> -<cmd> --<options> $ npx nlx <path> -<cmd> --<options>Commands -h, --help show help menu -l, --link link all dirs
Documentation
Table of Contents
getDirectories
getDirectories returns all directories in a given path
Parameters
pathTo
String relative path to monorepo or directory with node modulesopts
Object options to call the function with
Returns Array array of directories
getPackages
getPackages returs all packages
Parameters
dirs
Array array of directories
Returns Array array of packages & the relative path to them
getSharedDepDirs
getSharedDepDirs selects an array of shared and linked packages
Parameters
Returns Array A filtered list of shared pkg dirs
getSharedLinked
getSharedLinked selects an array of shared and linked packages
Parameters
Returns Array A filtered list of packages
getSharedDeps
getSharedDeps will show any shared dependencies between project & target dir
Parameters
Returns Array Array of shared dep names
getLinkedDeps
getLinkedDeps returns a list of linked dependencies
Parameters
pkgs
Array An array of dependencies
Returns Array Array of linked dep names