Require a file without adding it into the require cache
Installations
npm install requirefresh
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=4
Node Version
20.10.0
NPM Version
10.2.3
Score
99
Supply Chain
100
Quality
76.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
bevry
Download Statistics
Total Downloads
38,138,220
Last Day
7,637
Last Week
50,401
Last Month
292,209
Last Year
4,157,187
GitHub Statistics
1 Stars
265 Commits
1 Forks
2 Watching
1 Branches
4 Contributors
Bundle Size
850.00 B
Minified
456.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
5.13.0
Package Id
requirefresh@5.13.0
Unpacked Size
40.59 kB
Size
11.04 kB
File Count
12
NPM Version
10.2.3
Node Version
20.10.0
Publised On
29 Dec 2023
Total Downloads
Cumulative downloads
Total Downloads
38,138,220
Last day
-11.5%
7,637
Compared to previous day
Last week
-23.7%
50,401
Compared to previous week
Last month
-16.9%
292,209
Compared to previous month
Last year
6.8%
4,157,187
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Require Fresh
Require a file without adding it into the require cache
Usage
Here is an example that uses Require Fresh to load the package.json
file without caching.
1// Import 2const { 3 requireFresh, 4 requireFreshCallback, 5 requireFreshPromise, 6} = require('requirefresh') 7 8// Require the module freshly synchronously (will throw errors) 9try { 10 const result = requireFresh('./package.json') 11 console.log(result) 12} catch (error) { 13 console.error(error) 14} 15 16// Require the fresh module synchronously via a callback that contains the error and result 17requireFreshCallback('./package.json', function (error, result) { 18 if (error) { 19 console.error(error) 20 } else { 21 console.log(result) 22 } 23}) 24 25// Require the fresh module synchronously via a promise 26requireFreshPromise('./package.json') 27 .then((result) => console.log(result)) 28 .catch((error) => console.error(error))
Install
npm
- Install:
npm install --save requirefresh
- Import:
import pkg from ('requirefresh')
- Require:
const pkg = require('requirefresh').default
Deno
1import pkg from 'https://unpkg.com/requirefresh@^5.13.0/edition-deno/index.ts'
Editions
This package is published with the following editions:
requirefresh/source/index.ts
is TypeScript source code with Import for modulesrequirefresh
aliasesrequirefresh/edition-es2022/index.js
requirefresh/edition-es2022/index.js
is TypeScript compiled against ES2022 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modulesrequirefresh/edition-types/index.d.ts
is TypeScript compiled Types with Import for modulesrequirefresh/edition-deno/index.ts
is TypeScript source code made to be compatible with Deno
History
Discover the release history by heading on over to the HISTORY.md
file.
Backers
Code
Discover how to contribute via the CONTRIBUTING.md
file.
Authors
- Benjamin Lupton — Accelerating collaborative wisdom.
Maintainers
- Benjamin Lupton — Accelerating collaborative wisdom.
Contributors
Finances
Sponsors
- Andrew Nesbitt — Software engineer and researcher
- Balsa — We're Balsa, and we're building tools for builders.
- Codecov — Empower developers with tools to improve code quality and testing.
- Poonacha Medappa
- Rob Morris
- Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
- Syntax — Syntax Podcast
Donors
- Andrew Nesbitt
- Armen Mkrtchian
- Balsa
- Chad
- Codecov
- dr.dimitru
- Elliott Ditman
- entroniq
- GitHub
- Hunter Beast
- Jean-Luc Geering
- Michael Duane Mooring
- Michael Harry Scepaniak
- Mohammed Shah
- Mr. Henry
- Nermal
- Pleo
- Poonacha Medappa
- Rob Morris
- Robert de Forest
- Sentry
- ServieJS
- Skunk Team
- Syntax
- WriterJohnBuck
License
Unless stated otherwise all works are:
- Copyright © Benjamin Lupton
and licensed under:
No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
Reason
SAST tool is not run on all commits -- score normalized to 4
Details
- Warn: 7 commits out of 16 are checked with a SAST tool
Reason
Found 0/14 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: jobLevel 'contents' permission set to 'write': .github/workflows/bevry.yml:80
- Warn: no topLevel permission defined: .github/workflows/bevry.yml:1
Reason
1 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/bevry.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bevry.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bevry.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bevry.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bevry.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bevry.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bevry.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bevry.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bevry.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/bevry/requirefresh/bevry.yml/master?enable=pin
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 4 third-party GitHubAction dependencies pinned
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 'master'
Score
4.1
/10
Last Scanned on 2024-12-30
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