Git Product home page Git Product logo

npm-link-copy's Introduction

npm-link-copy

Alternative to npm link that works by copying files instead of linking.

Why this fork?

This fork is based on laggingreflex's package. That one is great, but it only supports listening to file changes in the watch mode. This is fixed here: the tool now watches for adding, removing and renaming files and directories.

Why?

Suppose you have the following setup:

/home
├───your-projects
│   └───some-project
├───your-npm-libs
│   └───your-awesome-module

Where some-project uses your-awesome-module.

While developing locally, you'd obviously want to make use of npm link

~/your-npm-libs/your-awesome-module $ npm link
~/your-projects/some-project $ npm link your-awesome-module

While this does link your-awesome-module inside some-project/node_modules and you can carry on as though it's actually installed, but internally node uses fs.realPath and therefore knows that your-awesome-module is actually in ~/your-npm-libs/your-awesome-module and not really in some-project/node_modules/your-awesome-module. This reflects in things like require calls or access to __dirname from your module or its dependencies which sometimes causes issues.

So to help with that, this tool actually copies your-awesome-module in some-project/node_modules/your-awesome-module and optionally keeps it updated (with --watch)

One downside is that you need to run it every time you make changes to your-awesome-module

Install

npm install -g blissi/npm-link-copy

Usage

npm-link-copy [..modules] [options]
  • --watch, -w Watch for changes
  • --ignored, -i [default:['node_modules', '.git']] Ignored dirs
  • --clearInitially, -c Clears the target directory initially.
  • --verbose, -v Log every file and directory operation that's done.

Libraries used

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.