Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
/ symlink-modules Public archive

Symlink module dependencies to ensure a consistent path to access module-files

Notifications You must be signed in to change notification settings

ad-si/symlink-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Symlink Modules

Since npm version 3.0.0 npm tries to install the dependency tree maximally flat. (https://github.com/npm/npm/releases/tag/v3.0.0)

This means it is not possible to know in advance where the module directory will be on the disk. Therefore statically loading files from a module directory can not be safely used anymore.

Symlink-modules let's you symlink your dependencies to a consistent location so that the files can be loaded from there.

Installation

npm install --save symlink-modules

Usage

Command Line

symlink-modules <dependency-1> <dependency-2>

This will create a linked_modules directory and symlink the specified dependencies.

Javascript

const symlinkModules = require('symlink-modules')

symlinkModules('dependency-1')

// or

symlinkModules(
	['dependency-2', 'dependency-3'],
	options
)

Possible options:

{
	linksDirectory: '<path>' // default: linked_modules
}

About

Symlink module dependencies to ensure a consistent path to access module-files

Topics

Resources

Stars

Watchers

Forks