Giter Club home page Giter Club logo

linkr's Introduction

linkr

Build Status

An npm package to make managing npm links easier.

Are you working on a sufficiently large NodeJS project with dependent projects that rely on each other? If so, then you are probably using npm link to make working with multiple local packages easier.

Installation

Install linkr globally using npm. This may require sudo access, depending on your OS.

$ npm install -g linkr

Usage

Let's assume that you have a directory setup similar to the following example. Your foo-api project is your primary application, and it depends on both foo-caching and foo-models. While you might have been able to write this as one very large Node package, it was decided that there would be value if the foo-caching and foo-models projects could shared in multiple projects.

path/to/foo/
    foo-api/
        package.json
    foo-caching/
        package.json
    foo-models/
        package.json

In your foo-api/package.json, add a links section under config.

{
  "name": "foo-api",
  "version": "0.0.0",
  "dependencies": {
    "foo-caching": "~2.1.0",
    "foo-models": "~3.17.0"
  },
  "config": {
    "links": [
      "../foo-caching",
      "../foo-models"
    ]
  }
}

In your development environment, you will want to use symbolic links. You can now run linkr from the project root (i.e. the same folder that contains the package.json file).

$ cd path/to/foo/foo-api
$ linkr

Commands

link (default)

Run all prescribed npm links. This is the default command.

sudo may be required

Because npm link makes use of the global node_modules directory, you may need to run linkr as sudo. If you want to avoid running as sudo, then you need to set up your linked projects independently. Example:

Running as sudo

/foo/foo-api $ sudo linkr

Without running as sudo

For this to work, you will need to set up your links configuration with project names, not relative paths.

$ cd path/to/foo-caching
$ sudo npm link
$ cd ../foo-models
$ sudo npm link
$ cd ../foo-api
$ linkr

help

Show help text.

version

Show linkr version

remove

Remove symbolic links.

Contributors

Fusion Alliance Logo linkr is a product of Fusion Alliance © 2015.

License

The MIT License (MIT)

Copyright (c) 2015 Fusion Alliance

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

linkr's People

Contributors

jarrettmeyer avatar naptowncode 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.