nodejs / nodejs/require-in-the-middle
[question]could this package be used to wrap local files?
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 186
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
Like I have a Test.js file,
could i change it like this:
const path = require("path");
const { Hook } = require("require-in-the-middle");
// Hook into the Test module
new Hook(["./Test.js"], function (exports, name, basedir) {
// 在这里对Test模块进行修改或扩展
console.log("Hooked into Test module:", name);
// 返回你想要的修改后的exports对象
return exports;
});
const Test = require("./Test.js");
console.log(`Test`, Test);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Hook usage shown in the issue and the local Test.js example. Read the package documentation and relevant Hook entry point to determine whether local files are supported; done means documenting a confirmed usage or identifying the limitation and required scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100