Installations
npm install import-local-file
Developer
sindresorhus
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
>=4
Typescript Support
No
Node Version
7.6.0
NPM Version
3.10.10
Statistics
154 Stars
30 Commits
11 Forks
7 Watching
1 Branches
8 Contributors
Updated on 18 Sept 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
712,255
Last day
-88.7%
111
Compared to previous day
Last week
78.2%
4,552
Compared to previous week
Last month
91.4%
8,929
Compared to previous month
Last year
-31.8%
44,899
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
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
1npm install import-local
Usage
1import importLocal from 'import-local'; 2 3if (importLocal(import.meta.url)) { 4 console.log('Using local version of this package'); 5} else { 6 // Code for both global and local version here… 7}
You can also pass in __filename
when used in a CommonJS context.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 8/30 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/import-local/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/import-local/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:23
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 8 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More