Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

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
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
25,010,557
increased by7.58%

Weekly downloads

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

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
Socket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc