Giter VIP home page Giter VIP logo

npm-file-link's Introduction

Build status Coverage Status Quality Gate

NPM dependencies Last commit Last release

NPM downloads License

Npm file link

CLI for automatically linking npm repositories locally using "file:" method.

Install

npm i npm-file-link -g

Usage

All npm package repositories to be linked have to be under the same folder.

Linking an specific package:

Inside any package folder you can run:

npm-file-link

The tool will find dependencies able to be linked because are cloned locally too in the same folder level, and will let you choose which ones to link using a CLI:

Choose package screenshot

Once you have chosen the dependencies to link, it will replace them locally by the correspondent file:.. dependency in the current package and will run an npm i automatically. (Previous defined versions of the dependencies will be stored into a property in the package.json file automatically, and will be restored when the package is unlinked)

To remove all links in the current package, restore dependencies to their original versions, and reinstall them:

npm-file-link -ua

Linking all packages

Inside any package folder you can run:

npm-file-link -a

Unlinking all packages:

npm-file-link --unlink --all

...or:

npm-file-link -ua

Options

Option Alias Description
--check -c Throw an error if there are locally linked packages
--all -a Apply command to all locally found dependencies. Do not prompt
--unlink -u Unlink packages. Has to be used with the -a option
--help -h Display help
--version -v Output the current version

Caveats

Do not commit local modifications.

Linked packages have have modifications in the package.json and in the package-lock.json file that should never be pushed to the remote repository.

Before pushing any change, you must execute:

npm-file-link -ua

To avoid pushing local links to the remote repository, this package provides a check command that should be executed as a precommit hook.

npm-file-link --check

Do not install or modify any other dependency while packages are linked.

While you have locally linked dependencies, the package-lock.json file is modified by npm according to local paths references. This file should be reverted after unlinking dependencies, so do not install or upgrade any other dependency while you have local links.

Support (OS Terminals)

npm-file-link uses inquirer for displaying CLI. You can consult his OS Terminals support here.

Contributing

Contributors are welcome. Please read the contributing guidelines and code of conduct.

npm-file-link's People

Contributors

javierbrea avatar gabrielseco avatar

Stargazers

Dane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.