Recursively soft links all occurrences of a directory to another one.
lnr ../myapp-core core --filter package
Let's say you have a
core package that is used by lots of your dependencies, some nested deeply in your dependency
tree. Now you want to work on the
core package and make sure that all of them link to the code you are working on.
That's when you need this.
npm install lnr
lnr <linktoDir> <dirname> -- <lnr-options>Links all directories with name <dirname>, found recursively from the current dir, to the <linktoDir>.If dirname is not supplied it defaults to the name of the directory being linked to.OPTIONS:-l, --loglevel level at which to log: silly|verbose|info|warn|error|silent -- default: info-f, --filter additional filters to apply to than just matching <dirname>currently existing filters are:- package: matches if the directory contains an npm package, i.e. the parentdirectory is node_modules-h, --help Print this help message.EXAMPLES:Link all directories with name mydir to the directory of the same name that is a sibling of my current working dirlnr ../mydir mydirSame as above, but omitting the dirname since it is the same as the name of the directory being linked tolnr ../mydir mydirLink all directories with name mydir to the directory of the same name that is a sibling of my current working dir andan npm package and log verbose.lnr ../mydir mydir --filter package -l verbose
Starts at given
root and recurses into all subdirectories.
Each directory found whose name matches
dirname is linked to
directory at which to start searching
directory to link
destination directory to link to
options that allow customizing which directories are linked
called back when all directories were linked
event emitter that emits events about the linking progress
A built in filter that returns
true if the directory is considered an npm package.
This is determined by ensuring that the parent directory is
full path to the directory to test
true if it is a package, otherwise
generated with docme