This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/import-local
cranberry ed23347e56 Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
..
fixtures Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
index.js Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
license Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
package.json Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
readme.md Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00

readme.md

import-local Build Status

Let a globally installed package use a locally installed version of itself if available

Useful for CLI tools that want to defer to the users locally installed version when available, but still work if its not installed locally. For example, AVA and XO uses this method.

Install

$ npm install import-local

Usage

const importLocal = require('import-local');

if (importLocal(__filename)) {
    console.log('Using local version of this package');
} else {
    // Code for both global and local version here…
}

License

MIT © Sindre Sorhus