• This repository has been archived on 09/May/2024
  • Stars
    star
    137
  • Rank 265,336 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

links a folder of local modules with inter-dependencies to the target directory

npm-link-shared

Version Build Status Downloads Dependencies

Installs a set of local node modules into a target folder using npm link. Links all dependencies of the local modules if they are listed in the source folder.

Blog post explaining this module.

Installation

npm install npm-link-shared -g

Changelog

v0.5.2 (2017-09-07) - Updated dependencies. Added package-lock.json.

v0.5.1 (2017-05-19) - Support for --include-peer which links peer dependencies if they are defined.

v0.5.0 (2017-03-29) - BREAKING CHANGES: The lib/api function's arguments have been revamped. The previously undocumented argument --includeDev is now --include-dev to be consistent with other arguments. We now print a warning and exit gracefully if either the shared or target directory do not exist.

v0.4.0 (2017-03-13) - Support for changing executable to yarn with --yarn. Use at your own risk! yarn link is not yet functionally equivalent to npm link.

v0.3.3 (2016-07-01) - Support for npm link options, removed hardcoded usage of --production.

v0.3.0 (2016-03-25) - Support for @scope packages. For example, @scope/my-package.

v0.2.1 (2016-01-12) - Thanks to @barroudjo, module folder names are now de-coupled from the names in the package.json. So any name can be used as a folder name.

v0.2.0 (2015-10-30) - Links using --production flag so that devDependencies should not be installed anymore. Tests added.

v0.1.6 (2015-04-20) - Removed unneeded npm dependency. Added a possibility to define which modules to install.

Usage

  npm-link-shared <shared-modules-dir> <target-installation-dir> [<module1..> [, <module2..>]] [--yarn] [--include-dev] [--include-peer] [--<npm-link-option> [--<npm-link-option>]]

For example:

  npm-link-shared /home/user/internal_modules/ /home/user/my-project

This links all modules located in the internal_modules directory to the my-project dir.

Define specific modules to install

  npm-link-shared /home/user/internal_modules/ /home/user/my-project my-module1 my-module2

This links modules my-module1 and my-module2 located in the internal_modules directory to the my-project dir. Only these two modules are installed but their dependencies are resolved against the entire internal_modules directory.

Define options passed to npm link

  npm-link-shared /home/user/internal_modules/ /home/user/my-project --production

This prevents installation of devDependencies of shared modules by passing the production option to npm link (npm link --production).

Use yarn instead

NOTE: yarn link is currently functionally different from npm link, and should not be considered stable. Use at your own risk until the yarn project has stabilized.

  npm-link-shared /home/user/internal_modules/ /home/user/my-project --yarn

This works in conjunction with all other options.

Also link devDependencies and/or peerDependencies

devDependencies:

  npm-link-shared /home/user/internal_modules/ /home/user/my-project --include-dev

peerDependencies:

  npm-link-shared /home/user/internal_modules/ /home/user/my-project --include-peer

Ordinarily, only packages found under the dependencies key in a project's package.json are linked. With this option, devDependencies and/or peerDependencies are also linked.

Developing

To run tests successfully, you must have both npm and yarn in your $PATH.

LICENSE

MIT

More Repositories

1

koa2-example-app

An app that is built using koa2 and async/await
JavaScript
85
star
2

jsperf

Run jsperf.com tests locally with your NodeJS version
HTML
34
star
3

base-x-rs

Encode/decode any base
Rust
22
star
4

pg-queue

Transactional background processing with PostgreSQL and Node.js/TypeScript
TypeScript
19
star
5

typed-messenger-platform

Toolkit for developing applications for the Messenger platform written in TypeScript.
TypeScript
16
star
6

jspm-ember-playground

Basic Ember app which uses JSPM as a package manager
JavaScript
16
star
7

aws-lambda-nodejs-cloudformation-starter-kit

AWS Lambda CloudFormation NodeJS Starter
Shell
14
star
8

native-exec

Module that provides access to POSIX exec* functions"
C++
13
star
9

routine

Routing engine in NodeJS
JavaScript
12
star
10

schema-script

Zero-configuration pre-processor for generating runtime and static TypeScript/GraphQL types based on JSON schemas.
TypeScript
8
star
11

api-express

Universal language for defining and documenting APIs using JSX
JavaScript
8
star
12

jspm-testem

Tests for JSPM projects with Testem
JavaScript
7
star
13

fb-message-builder

Build messages for Facebook Messenger API using fb-message-builder
JavaScript
7
star
14

show-tab

ShowTab: track TV shows you watch in the Chrome's new tab
JavaScript
5
star
15

migrations-engine

Simple library to manage database migrations in-memory
TypeScript
3
star
16

buildless

Development HTTP server and deployment tool for static websites.
TypeScript
3
star
17

jspm-universal-js-demo

Universal Javascript With JSPM
JavaScript
2
star
18

wi

JavaScript
2
star
19

git-bulk

Shell
2
star
20

gatsby-css-issue

Repository to reproduce the issue with css not being updated for server-rendered code
CSS
2
star
21

marked-benchmark

Benchmark of marked with different sanitizers
JavaScript
2
star
22

node-webshot-server

A server for node-webshot
JavaScript
1
star