Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

import-local

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Issues
File Explorer

Advanced tools

import-local

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

    3.1.0latest

Version published
Maintainers
1
Weekly downloads
22,340,317
decreased by-11.85%

Weekly downloads

Changelog

Source

  • Support import.meta.url (#13) d0f784e

https://github.com/sindresorhus/import-local/compare/v3.0.3...v3.1.0

Readme

Source

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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is import-local?

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

Is import-local popular?

The npm package import-local receives a total of 17,830,787 weekly downloads. As such, import-local popularity was classified as popular.

Is import-local well maintained?

We found that import-local demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 06 Jan 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc