Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stealthy-require

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stealthy-require

The closest you can get to require something with bypassing the require cache

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is stealthy-require?

The stealthy-require npm package allows you to require a module in a way that avoids caching, enabling you to load the module fresh every time. This can be useful for testing, mocking, or when you need to ensure that the module's state is reset.

What are stealthy-require's main functionalities?

Require a module without caching

This feature allows you to require a module without it being cached. This is useful when you need to ensure that the module is loaded fresh every time, such as in testing scenarios.

const stealthyRequire = require('stealthy-require');

// Load the module without caching
const myModule = stealthyRequire(require.cache, function () {
  return require('my-module');
});

Require a module with specific dependencies

This feature allows you to require a module along with specific dependencies. This can be useful when you need to control the environment in which the module is loaded.

const stealthyRequire = require('stealthy-require');

// Load the module with specific dependencies
const myModule = stealthyRequire(require.cache, function () {
  return require('my-module');
}, function () {
  require('dependency1');
  require('dependency2');
});

Other packages similar to stealthy-require

Keywords

FAQs

Package last updated on 09 May 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc