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

@file-services/node

Package Overview
Dependencies
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@file-services/node - npm Package Compare versions

Comparing version 5.4.3 to 5.7.0

34

dist/node-fs.js

@@ -13,2 +13,4 @@ "use strict";

const watch_service_js_1 = require("./watch-service.js");
const nodeMajor = parseInt(process.versions.node, 10);
const needsStatPolyfill = nodeMajor < 14;
const caseSensitive = !fs_1.default.existsSync(__filename.toUpperCase());

@@ -27,2 +29,4 @@ function createNodeFs(options) {

...fs_1.default,
statSync: needsStatPolyfill ? statSync : fs_1.default.statSync,
lstatSync: needsStatPolyfill ? lstatSync : fs_1.default.lstatSync,
promises: {

@@ -35,2 +39,32 @@ ...fs_1.default.promises,

exports.createBaseNodeFs = createBaseNodeFs;
function statSync(path, options) {
var _a;
try {
return fs_1.default.statSync(path, options);
}
catch (e) {
const throwIfNoEntry = (_a = options === null || options === void 0 ? void 0 : options.throwIfNoEntry) !== null && _a !== void 0 ? _a : true;
if (throwIfNoEntry) {
throw e;
}
else {
return undefined;
}
}
}
function lstatSync(path, options) {
var _a;
try {
return fs_1.default.lstatSync(path, options);
}
catch (e) {
const throwIfNoEntry = (_a = options === null || options === void 0 ? void 0 : options.throwIfNoEntry) !== null && _a !== void 0 ? _a : true;
if (throwIfNoEntry) {
throw e;
}
else {
return undefined;
}
}
}
//# sourceMappingURL=node-fs.js.map

8

package.json
{
"name": "@file-services/node",
"description": "Node.js file system implementation.",
"version": "5.4.3",
"version": "5.7.0",
"main": "dist/index.js",
"scripts": {
"test": "yarn test:node",
"test": "npm run test:node",
"test:node": "mocha \"./dist/test/*.{spec,nodespec}.js\""
},
"dependencies": {
"@file-services/types": "^5.4.0",
"@file-services/utils": "^5.4.0"
"@file-services/types": "^5.7.0",
"@file-services/utils": "^5.7.0"
},

@@ -14,0 +14,0 @@ "files": [

@@ -7,5 +7,13 @@ import fs from 'fs';

import { createFileSystem } from '@file-services/utils';
import type { IBaseFileSystem, IFileSystem, IFileSystemPath } from '@file-services/types';
import type {
IBaseFileSystem,
IFileSystem,
IFileSystemPath,
IFileSystemStats,
StatSyncOptions,
} from '@file-services/types';
import { NodeWatchService, INodeWatchServiceOptions } from './watch-service.js';
const nodeMajor = parseInt(process.versions.node, 10);
const needsStatPolyfill = nodeMajor < 14;
const caseSensitive = !fs.existsSync(__filename.toUpperCase());

@@ -29,2 +37,4 @@

...fs,
statSync: needsStatPolyfill ? statSync : fs.statSync,
lstatSync: needsStatPolyfill ? lstatSync : fs.lstatSync,
promises: {

@@ -36,1 +46,31 @@ ...fs.promises,

}
function statSync(path: string, options?: StatSyncOptions & { throwIfNoEntry?: true }): IFileSystemStats;
function statSync(path: string, options: StatSyncOptions & { throwIfNoEntry: false }): IFileSystemStats | undefined;
function statSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined {
try {
return fs.statSync(path, options as fs.StatOptions);
} catch (e) {
const throwIfNoEntry = options?.throwIfNoEntry ?? true;
if (throwIfNoEntry) {
throw e;
} else {
return undefined;
}
}
}
function lstatSync(path: string, options?: StatSyncOptions & { throwIfNoEntry?: true }): IFileSystemStats;
function lstatSync(path: string, options: StatSyncOptions & { throwIfNoEntry: false }): IFileSystemStats | undefined;
function lstatSync(path: string, options?: StatSyncOptions): IFileSystemStats | undefined {
try {
return fs.lstatSync(path, options as fs.StatOptions);
} catch (e) {
const throwIfNoEntry = options?.throwIfNoEntry ?? true;
if (throwIfNoEntry) {
throw e;
} else {
return undefined;
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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