3.2.0 • Published 5 months ago

import-local v3.2.0

Weekly downloads
18,224,666
License
MIT
Repository
github
Last release
5 months ago

import-local

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

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

Install

npm install import-local

Usage

import importLocal from 'import-local';

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

You can also pass in __filename when used in a CommonJS context.

jest-clijestwebpack-clilerna@xdn/cli@whr2349/corefree-min@allview-cli/core@bsolution/cli@bsolution/create-bsolution-app@strive-cli/cli@knzn-cli/cli@knzn/cli@vc-cli-dev/core@vic-cli-test/core@imohuan-dev/cli@zml-lerna-test/corearchetype-library@cli-zx-test/core@dong-cli/core@def-builder/core@flying_feather/create-flying-feather-app@hazymoon-cli-dev/corecomponennentt@layer0/clieasy-select-rnvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-imagespecify-importsbabel-specify-imports@icanpm/api-masterwebpack-dev-server-http2react-native-template-rfbase@irisview/jest-cliairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@willes-cli-dev/bootdeneme323112@ecej-cli/core@texttree/demo-bsa-reference-rcl@lw-cli-dev/core@fundefund/funde_ck@ntt_app/react-native-custom-notificationbamboo-react-cli@aotemanlei/cli@mck-cli-dev/core@cobber/core@form-cli-dev/coretreact-native-covid-sdkgql_din_mod@zxy-cli/clibitgetljj-cli@ljj-cli/cli@lzwcl-cli-dev/core@samuel-template-cli/core@suanlafen/core@l1nyanm1ng/react-picture-viewer@upp-cli/core@dx-cli-dev/core@blink-cli-dev/core@czq-cli/core@wejee-lego-cli/cli@stars-cli/corecctv-clicthpb-plugin-social@yange-cli/core@ygdsj/corewx-page-template-jswx-component-template-jspackx@pkq-cli/core@olivervorasai/slider@l9m-cli-dev/corereact-native-printer-brotherswx-component-templatewx-page-templatecbmis-ai-toolbox@render-web/core@todd-cli/corelin-hubreact-native-shekhar-bridge-testcogoportutils@easywork-cli-dev/cli@cm-cli/core@imooc-cli-czj/core@rice-cli/clilevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28
3.2.0

5 months ago

3.1.0

3 years ago

3.0.3

3 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.0.0

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago