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

require-at

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-at

Call require pretending your are at another directory

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
545K
decreased by-2.27%
Maintainers
1
Weekly downloads
 
Created

What is require-at?

The require-at npm package allows you to require modules from a specific path, essentially letting you control the module resolution process. This can be particularly useful in scenarios where you need to load a module relative to a different directory than the current one.

What are require-at's main functionalities?

Require a module from a specific path

This feature allows you to require a module as if the require call was made from a different directory. This can be useful for loading modules in a controlled environment or from a specific location.

const requireAt = require('require-at');
const someModule = requireAt('/path/to/directory')('some-module');

Resolve a module path from a specific path

This feature allows you to resolve the path of a module as if the resolution was done from a different directory. This can be useful for determining the exact path of a module without actually loading it.

const requireAt = require('require-at');
const modulePath = requireAt('/path/to/directory').resolve('some-module');

Other packages similar to require-at

FAQs

Package last updated on 28 Nov 2020

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