@thi.ng/file-io
Advanced tools
Comparing version 1.3.1 to 1.3.2
# Change Log | ||
- **Last updated**: 2024-02-19T16:07:07Z | ||
- **Last updated**: 2024-02-22T11:59:16Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,8 @@ | ||
### [1.3.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/file-io@1.3.2) (2024-02-22) | ||
#### ♻️ Refactoring | ||
- update all `node:*` imports ([c71a526](https://github.com/thi-ng/umbrella/commit/c71a526)) | ||
## [1.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/file-io@1.3.0) (2024-02-19) | ||
@@ -14,0 +20,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { unlinkSync } from "fs"; | ||
import { unlinkSync } from "node:fs"; | ||
const deleteFile = (path, logger, dryRun = false) => { | ||
@@ -3,0 +3,0 @@ logger && logger.info(`${dryRun ? "[dryrun] " : ""}deleting file: ${path}`); |
@@ -1,3 +0,3 @@ | ||
import { existsSync, mkdirSync, statSync } from "fs"; | ||
import { dirname } from "path"; | ||
import { existsSync, mkdirSync, statSync } from "node:fs"; | ||
import { dirname } from "node:path"; | ||
const ensureDir = (dir) => dir.length > 0 && !existsSync(dir) ? (mkdirSync(dir, { recursive: true }), true) : false; | ||
@@ -4,0 +4,0 @@ const ensureDirForFile = (path) => ensureDir(dirname(path)); |
import { U32 } from "@thi.ng/hex"; | ||
import { open } from "fs/promises"; | ||
import { open } from "node:fs/promises"; | ||
async function* fileChunks(path, opts) { | ||
@@ -4,0 +4,0 @@ let { logger, size, start, end } = { |
@@ -1,3 +0,3 @@ | ||
import { readdirSync, statSync } from "fs"; | ||
import { sep } from "path"; | ||
import { readdirSync, statSync } from "node:fs"; | ||
import { sep } from "node:path"; | ||
import { isDirectory } from "./dir.js"; | ||
@@ -4,0 +4,0 @@ import { __ensurePred } from "./internal/ensure.js"; |
@@ -1,3 +0,3 @@ | ||
import { createHash } from "crypto"; | ||
import { readFileSync } from "fs"; | ||
import { createHash } from "node:crypto"; | ||
import { readFileSync } from "node:fs"; | ||
const fileHash = (path, logger, algo = "sha256") => { | ||
@@ -4,0 +4,0 @@ const sum = createHash(algo); |
{ | ||
"name": "@thi.ng/file-io", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Assorted file I/O utils (with logging support) for NodeJS", | ||
@@ -38,7 +38,7 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.9.24", | ||
"@thi.ng/checks": "^3.4.24", | ||
"@thi.ng/hex": "^2.3.36", | ||
"@thi.ng/logger": "^3.0.1", | ||
"@thi.ng/random": "^3.6.31" | ||
"@thi.ng/api": "^8.9.25", | ||
"@thi.ng/checks": "^3.5.0", | ||
"@thi.ng/hex": "^2.3.37", | ||
"@thi.ng/logger": "^3.0.2", | ||
"@thi.ng/random": "^3.6.32" | ||
}, | ||
@@ -124,3 +124,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "2724c87ca41810f2112f9d8c3d6b90dfaeea876b\n" | ||
"gitHead": "4513a1c703bdbf0f0867f03e547e47692e415fac\n" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { readFileSync } from "fs"; | ||
import { readFileSync } from "node:fs"; | ||
const readBinary = (path, logger) => { | ||
@@ -3,0 +3,0 @@ logger && logger.debug("reading file:", path); |
@@ -21,3 +21,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
> [!NOTE] | ||
> This is one of 189 standalone projects, maintained as part | ||
> This is one of 190 standalone projects, maintained as part | ||
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo | ||
@@ -63,3 +63,3 @@ > and anti-framework. | ||
Package sizes (brotli'd, pre-treeshake): ESM: 1.98 KB | ||
Package sizes (brotli'd, pre-treeshake): ESM: 1.99 KB | ||
@@ -66,0 +66,0 @@ ## Dependencies |
import { isString } from "@thi.ng/checks/is-string"; | ||
import { randomID } from "@thi.ng/random/random-id"; | ||
import { realpathSync, writeFileSync } from "fs"; | ||
import { tmpdir } from "os"; | ||
import { sep } from "path"; | ||
import { realpathSync, writeFileSync } from "node:fs"; | ||
import { tmpdir } from "node:os"; | ||
import { sep } from "node:path"; | ||
import { ensureDirForFile } from "./dir.js"; | ||
@@ -7,0 +7,0 @@ const createTempFile = (body, logger, name) => { |
import { isArray } from "@thi.ng/checks/is-array"; | ||
import { readFileSync } from "fs"; | ||
import { readFileSync } from "node:fs"; | ||
import { writeFile } from "./write.js"; | ||
@@ -4,0 +4,0 @@ const readText = (path, logger, encoding = "utf-8") => { |
/// <reference types="node" /> | ||
import { type Event, type IClear, type INotify, type IObjectOf, type Listener, type Predicate } from "@thi.ng/api"; | ||
import type { ILogger } from "@thi.ng/logger"; | ||
import { type FSWatcher } from "fs"; | ||
import { type FSWatcher } from "node:fs"; | ||
export interface WatcherOpts { | ||
@@ -6,0 +6,0 @@ /** |
@@ -17,4 +17,4 @@ var __defProp = Object.defineProperty; | ||
import { NULL_LOGGER } from "@thi.ng/logger/null"; | ||
import { watch as $watch, existsSync } from "fs"; | ||
import { join } from "path"; | ||
import { watch as $watch, existsSync } from "node:fs"; | ||
import { join } from "node:path"; | ||
import { isDirectory } from "./dir.js"; | ||
@@ -21,0 +21,0 @@ import { __ensurePred } from "./internal/ensure.js"; |
/// <reference types="node" /> | ||
import type { TypedArray } from "@thi.ng/api"; | ||
import type { ILogger } from "@thi.ng/logger"; | ||
import { type WriteFileOptions } from "fs"; | ||
import { type WriteFileOptions } from "node:fs"; | ||
/** | ||
@@ -6,0 +6,0 @@ * Writes `body` as to given `path` (using optional `opts` to define encoding). |
import { isString } from "@thi.ng/checks/is-string"; | ||
import { writeFileSync } from "fs"; | ||
import { writeFileSync } from "node:fs"; | ||
import { ensureDirForFile } from "./dir.js"; | ||
@@ -4,0 +4,0 @@ const writeFile = (path, body, opts, logger, dryRun = false) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
39899
0
Updated@thi.ng/api@^8.9.25
Updated@thi.ng/checks@^3.5.0
Updated@thi.ng/hex@^2.3.37
Updated@thi.ng/logger@^3.0.2
Updated@thi.ng/random@^3.6.32