Gathering detailed insights and metrics for require-in-the-middle-jdkfix
Gathering detailed insights and metrics for require-in-the-middle-jdkfix
Gathering detailed insights and metrics for require-in-the-middle-jdkfix
Gathering detailed insights and metrics for require-in-the-middle-jdkfix
Module to hook into the Node.js require function
npm install require-in-the-middle-jdkfix
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (94.75%)
Makefile (4.77%)
TypeScript (0.48%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
175 Stars
127 Commits
30 Forks
17 Watchers
5 Branches
38 Contributors
Updated on May 15, 2025
Latest Version
5.3.0
Package Id
require-in-the-middle-jdkfix@5.3.0
Unpacked Size
13.20 kB
Size
4.91 kB
File Count
4
NPM Version
8.5.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Hook into the Node.js require
function. This allows you to modify
modules on-the-fly as they are being required.
npm install require-in-the-middle --save
1const path = require('path') 2const Hook = require('require-in-the-middle') 3 4// Hook into the express and mongodb module 5Hook(['express', 'mongodb'], function (exports, name, basedir) { 6 const version = require(path.join(basedir, 'package.json')).version 7 8 console.log('loading %s@%s', name, version) 9 10 // expose the module version as a property on its exports object 11 exports._version = version 12 13 // whatever you return will be returned by `require` 14 return exports 15})
The require-in-the-middle module exposes a single function:
hook = Hook([modules][, options], onrequire)
When called a hook
object is returned.
Arguments:
modules
<string[]> An optional array of module names to limit which modules
trigger a call of the onrequire
callback. If specified, this must be the
first argument. Both regular modules (e.g. react-dom
) and
sub-modules (e.g. react-dom/server
) can be specified in the array.options
<Object> An optional object containing fields that change when the
onrequire
callback is called. If specified, this must be the second
argument.
options.internals
<boolean> Specifies whether onrequire
should be called
when module-internal files are loaded; defaults to false
.onrequire
<Function> The function to call when a module is required.The onrequire
callback will be called the first time a module is
required. The function is called with three arguments:
exports
<Object> The value of the module.exports
property that would
normally be exposed by the required module.name
<string> The name of the module being required. If options.internals
was set to true
, the path of module-internal files that are loaded
(relative to basedir
) will be appended to the module name, separated by
path.sep
.basedir
<string> The directory where the module is located, or undefined
for core modules.Return the value you want the module to expose (normally the exports
argument).
hook.unhook()
Removes the onrequire
callback so that it will not be triggerd by
subsequent calls to require()
.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
security policy file detected
Details
Reason
Found 15/30 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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