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

@jsenv/filesystem

Package Overview
Dependencies
Maintainers
2
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/filesystem - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

2

package.json
{
"name": "@jsenv/filesystem",
"version": "2.7.0",
"version": "2.7.1",
"description": "Collection of functions to interact with filesystem in Node.js",

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

@@ -22,8 +22,16 @@ import { readdirSync, realpathSync } from "node:fs"

i++
const namesOnFileSystem = readdirSync(
// When Node.js receives "C:/" on windows it returns
// the process.cwd() directory content...
// This can be fixed by passing "file:///C:/" directly but as a url object
new URL(reconstructedFileUrl),
)
let namesOnFileSystem
try {
namesOnFileSystem = readdirSync(
// When Node.js receives "C:/" on windows it returns
// the process.cwd() directory content...
// This can be fixed by passing "file:///C:/" directly but as a url object
new URL(reconstructedFileUrl),
)
} catch (e) {
if (e && e.code === "ENOENT") {
return null
}
throw e
}
const foundOnFilesystem = namesOnFileSystem.includes(name)

@@ -36,2 +44,5 @@ if (foundOnFilesystem) {

)
if (!nameOnFileSystem) {
return null
}
reconstructedFileUrl += nameOnFileSystem

@@ -38,0 +49,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