Installations
npm install @activepieces/import-fresh-webpack
Developer
sindresorhus
Developer Guide
Module System
ESM
Min. Node Version
>=18
Typescript Support
Yes
Node Version
20.13.1
NPM Version
10.5.2
Statistics
283 Stars
32 Commits
24 Forks
8 Watching
2 Branches
7 Contributors
Updated on 24 Nov 2024
Bundle Size
1.69 kB
Minified
777.00 B
Minified + Gzipped
Languages
JavaScript (87.68%)
TypeScript (12.32%)
Total Downloads
Cumulative downloads
Total Downloads
19,536
Last day
38%
225
Compared to previous day
Last week
1.1%
1,145
Compared to previous week
Last month
11.8%
4,603
Compared to previous month
Last year
0%
19,536
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
import-fresh
Import a module while bypassing the cache
Useful for testing purposes when you need to freshly import a module.
ESM
For ESM, you can use this snippet:
1const importFresh = moduleName => import(`${moduleName}?${Date.now()}`); 2 3const {default: foo} = await importFresh('foo');
This snippet causes a memory leak, so only use it for short-lived tests.
Install
$ npm install import-fresh
Usage
1// foo.js 2let i = 0; 3module.exports = () => ++i;
1const importFresh = require('import-fresh'); 2 3require('./foo')(); 4//=> 1 5 6require('./foo')(); 7//=> 2 8 9importFresh('./foo')(); 10//=> 1 11 12importFresh('./foo')(); 13//=> 1
Related
- clear-module - Clear a module from the import cache
- import-from - Import a module from a given path
- import-cwd - Import a module from the current working directory
- import-lazy - Import modules lazily
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
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
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/import-fresh/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/import-fresh/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:24
- 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
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 7 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