link-require

0.0.7 • Public • Published

link-require

Expose your source folder globally within your project.

This works by essentially creating a symlink of the source directory you wish to expose under node_modules.

Why

Because require('../../../../../../../../../') has to go.

Usage

Installation

npm install --save link-require

Setup

In your package.json:

{
  "scripts": {
    "postinstall": "link-require ./src:app"
   }
}

You can specify multiple mapping as well:

{
  "scripts": {
    "postinstall": "link-require ./src:src ./lib:lib"
   }
}

When requiring

const mySource = require('app/mySource')

Readme

Keywords

Package Sidebar

Install

npm i link-require

Weekly Downloads

0

Version

0.0.7

License

MIT

Last publish

Collaborators

  • notawizard
  • almirkadric
  • stelcheck