Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via pnpm

import-local 3.1.0

Let a globally installed package use a locally installed version of itself if available
Package summary
Share
0
issues
1
license
10
MIT
Package created
4 May 2017
Version published
6 Jan 2022
Maintainers
1
Total deps
10
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
find-up@4.1.0
import-local@3.1.0
locate-path@5.0.0
p-limit@2.3.0
p-locate@4.1.0
p-try@2.2.0
path-exists@4.0.0
pkg-dir@4.2.0
resolve-cwd@3.0.0
resolve-from@5.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
ⓘ This is a list of import-local 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
pkg-dir4.2.02.07 kBMIT
prod
resolve-cwd3.0.01.91 kBMIT
prod

Visualizations

Frequently Asked Questions

What does import-local do?

The "import-local" is a utility package that allows a globally installed package to utilize a locally installed version of itself when available. This is particularly useful for CLI tools that want to defer to the user's locally installed version when it's available, but still function if it's not installed locally. AVA and XO are such examples that make use of this method.

How do you use import-local?

To use import-local, first ensure that it is installed in your project by running the command: npm install import-local. Once done, you can include and use it in your JavaScript code as shown in the example below:

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…
}

In a CommonJS context, you can also pass in __filename.

Where are the import-local docs?

The official documentation of import-local can be found in its readme on the GitHub package site at: git+https://github.com/sindresorhus/import-local.git. The readme provides a detailed explanation of how to install and utilize import-local in a detailed and concise manner. There are no additional specific "import-local" docs aside from the readme on the GitHub page.