🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

import-fresh

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-fresh - npm Package Compare versions

Comparing version

to
3.2.0

15

index.js

@@ -11,11 +11,14 @@ 'use strict';

const filePath = resolveFrom(path.dirname(parentModule(__filename)), moduleId);
const parentPath = parentModule(__filename);
const filePath = resolveFrom(path.dirname(parentPath), moduleId);
const oldModule = require.cache[filePath];
// Delete itself from module parent
if (require.cache[filePath] && require.cache[filePath].parent) {
let i = require.cache[filePath].parent.children.length;
if (oldModule && oldModule.parent) {
let i = oldModule.parent.children.length;
while (i--) {
if (require.cache[filePath].parent.children[i].id === filePath) {
require.cache[filePath].parent.children.splice(i, 1);
if (oldModule.parent.children[i].id === filePath) {
oldModule.parent.children.splice(i, 1);
}

@@ -29,3 +32,3 @@ }

// Return fresh module
return require(filePath);
return require.cache[parentPath].require(filePath);
};

2

package.json
{
"name": "import-fresh",
"version": "3.1.0",
"version": "3.2.0",
"description": "Import a module while bypassing the cache",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -40,2 +40,9 @@ # import-fresh [![Build Status](https://travis-ci.org/sindresorhus/import-fresh.svg?branch=master)](https://travis-ci.org/sindresorhus/import-fresh)

## import-fresh for enterprise
Available as part of the Tidelift Subscription.
The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-import-fresh?utm_source=npm-import-fresh&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related

@@ -47,14 +54,1 @@

- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-require-uncached?utm_source=npm-require-uncached&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>