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 - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "require-at",
"version": "1.0.4",
"version": "1.0.5",
"main": "require-at.js",

@@ -5,0 +5,0 @@ "description": "Call require pretending your are at another directory",

"use strict";
const Path = require("path");
const Module = require("module");
const Fs = require("fs");
// use eval to avoid tripping bundlers
const xrequire = eval("require");
const createRequireFromPath =
Module.createRequireFromPath ||
((filename, dir) => {
// https://github.com/nodejs/node/blob/1ae0511b942c01c6e0adff98643d350a395bf101/lib/internal/modules/cjs/loader.js#L748
// https://github.com/nodejs/node/blob/1ae0511b942c01c6e0adff98643d350a395bf101/lib/internal/modules/cjs/helpers.js#L16
const m = new Module(filename);
const createRequireFromPath = require("./create-require");
m.filename = filename;
m.paths = Module._nodeModulePaths(dir);
// don't name this require to avoid tripping bundlers
function _require(request) {
// can't use m.require because there's an internal requireDepth thing
// in the native Module implementation
return xrequire(resolve(request));
}
function resolve(request, options) {
return Module._resolveFilename(request, m, false, options);
}
_require.resolve = resolve;
function paths(request) {
return Module._resolveLookupPaths(request, m, true);
}
resolve.paths = paths;
_require.main = process.mainModule;
_require.extensions = Module._extensions;
_require.cache = Module._cache;
return _require;
});
const cache = new Map();

@@ -45,0 +9,0 @@

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