Socket
Socket
Sign inDemoInstall

atomically

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

readme.md

5

dist/constants.js
/* IMPORT */
import os from 'node:os';
import process from 'node:process';
/* MAIN */

@@ -15,6 +16,6 @@ const DEFAULT_ENCODING = 'utf8';

const IS_USER_ROOT = process.getuid ? !process.getuid() : false;
const LIMIT_BASENAME_LENGTH = 128; //TODO: fetch the real limit from the filesystem //TODO: fetch the whole-path length limit too
const LIMIT_FILES_DESCRIPTORS = 10000; //TODO: fetch the real limit from the filesystem
const LIMIT_BASENAME_LENGTH = 128; //TODO: Fetch the real limit from the filesystem //TODO: Fetch the whole-path length limit too
const LIMIT_FILES_DESCRIPTORS = 10000; //TODO: Fetch the real limit from the filesystem
const NOOP = () => { };
/* EXPORT */
export { DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_USER_UID, DEFAULT_USER_GID, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX, IS_USER_ROOT, LIMIT_BASENAME_LENGTH, LIMIT_FILES_DESCRIPTORS, NOOP };

2

dist/index.d.ts

@@ -13,3 +13,3 @@ /// <reference types="node" />

declare function writeFile(filePath: Path, data: Data, options?: Encoding | WriteOptions, callback?: Callback): Promise<void>;
declare const writeFileSync: (filePath: Path, data: Data, options?: Encoding | WriteOptions) => void;
declare function writeFileSync(filePath: Path, data: Data, options?: Encoding | WriteOptions): void;
export { readFile, readFileSync, writeFile, writeFileSync };

@@ -116,3 +116,3 @@ /* IMPORT */

}
const writeFileSync = (filePath, data, options = DEFAULT_WRITE_OPTIONS) => {
function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
if (isString(options))

@@ -195,4 +195,4 @@ return writeFileSync(filePath, data, { encoding: options });

}
};
}
/* EXPORT */
export { readFile, readFileSync, writeFile, writeFileSync };
/// <reference types="node" />
declare type Callback = (error: Exception | void) => void;
declare type Data = Uint8Array | string | undefined;
declare type Disposer = () => void;
declare type Encoding = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2';
declare type Exception = NodeJS.ErrnoException;
declare type Path = string;
declare type ReadOptions = {
type Callback = (error: Exception | void) => void;
type Data = Uint8Array | string | undefined;
type Disposer = () => void;
type Encoding = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2';
type Exception = NodeJS.ErrnoException;
type Path = string;
type ReadOptions = {
encoding?: Encoding | null;

@@ -13,3 +13,3 @@ mode?: string | number | false;

};
declare type WriteOptions = {
type WriteOptions = {
chown?: {

@@ -16,0 +16,0 @@ gid: number;

@@ -5,3 +5,3 @@ {

"description": "Read and write files atomically and reliably.",
"version": "2.0.0",
"version": "2.0.1",
"type": "module",

@@ -30,14 +30,14 @@ "main": "dist/index.js",

"dependencies": {
"stubborn-fs": "^1.2.1",
"stubborn-fs": "^1.2.4",
"when-exit": "^2.0.0"
},
"devDependencies": {
"@types/node": "^18.11.9",
"esbuild": "^0.15.13",
"@types/node": "^18.13.0",
"esbuild": "^0.17.7",
"require-inject": "^1.4.4",
"tap": "^16.3.0",
"tsex": "^1.1.2",
"typescript": "^4.8.4",
"tap": "^16.3.4",
"tsex": "^2.1.0",
"typescript": "^4.9.5",
"write-file-atomic": "^5.0.0"
}
}

@@ -5,2 +5,3 @@

import os from 'node:os';
import process from 'node:process';

@@ -31,5 +32,5 @@ /* MAIN */

const LIMIT_BASENAME_LENGTH = 128; //TODO: fetch the real limit from the filesystem //TODO: fetch the whole-path length limit too
const LIMIT_BASENAME_LENGTH = 128; //TODO: Fetch the real limit from the filesystem //TODO: Fetch the whole-path length limit too
const LIMIT_FILES_DESCRIPTORS = 10000; //TODO: fetch the real limit from the filesystem
const LIMIT_FILES_DESCRIPTORS = 10_000; //TODO: Fetch the real limit from the filesystem

@@ -36,0 +37,0 @@ const NOOP = () => {};

@@ -195,3 +195,3 @@

const writeFileSync = ( filePath: Path, data: Data, options: Encoding | WriteOptions = DEFAULT_WRITE_OPTIONS ): void => {
function writeFileSync ( filePath: Path, data: Data, options: Encoding | WriteOptions = DEFAULT_WRITE_OPTIONS ): void {

@@ -198,0 +198,0 @@ if ( isString ( options ) ) return writeFileSync ( filePath, data, { encoding: options } );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc