Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

import-local

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-local

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

  • 3.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29M
increased by7.49%
Maintainers
1
Weekly downloads
 
Created

What is import-local?

The import-local npm package is designed to allow a globally installed package to defer to a locally installed version of itself when it is being run within a project that has that package as a dependency. This is useful for testing local changes to a package without having to publish the package or modify the global version.

What are import-local's main functionalities?

Deferring to local version

This code checks if a local version of the package is available. If it is, it will use the local version and log a message to the console. Otherwise, it will proceed with the global package's code.

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

Other packages similar to import-local

Keywords

FAQs

Package last updated on 24 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc