![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
require-like
Advanced tools
Generates require functions that act as if they were operating in a given path.
Generates require functions that act as if they were operating in a given path.
npm install require-like
A require function that acts as if it was executed in './lib/bar'
:
var requireLike = require('require-like');
var myRequire = requireLike(__dirname + '/lib/bar.js');
var myFoo = myRequire('./foo.js');
var foo = require('./lib/foo');
require('assert').strictEqual(myFoo, foo);
Returns a require function that acts as if it was operating in the given
path
.
Setting the uncached
parameter to true returns a function that by-passes the
module cache.
This module works by accessing some private node APIs. You shouldn't worry about that so, since I will make sure this module does not break in the future by either patching it, or making a patch for node that makes the needed APIs public.
I use this library for dependency injection in unit tests. However, you could also use it to create experimental require addons yourself.
require-like is licensed under the MIT license.
FAQs
Generates require functions that act as if they were operating in a given path.
The npm package require-like receives a total of 931,640 weekly downloads. As such, require-like popularity was classified as popular.
We found that require-like demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.