From c7bb20fdaa0b72428c986bf50c94b14c211f88bf Mon Sep 17 00:00:00 2001 From: ADITYA CHAUHAN <125276621+hooiv@users.noreply.github.com> Date: Sun, 16 Aug 2026 00:05:21 +0530 Subject: [PATCH] refactor: use node: prefix for Node.js core module imports --- lib/core.js | 6 ++++-- lib/plugins/tar.js | 2 +- lib/utils.js | 1 + test/archiver.js | 3 ++- test/helpers/index.js | 9 +++++---- test/plugins.js | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/core.js b/lib/core.js index 1bcf33af9..e42e37d0b 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,4 +1,4 @@ -import { createReadStream, lstat, readlinkSync, Stats } from "fs"; +import { createReadStream, lstat, readlinkSync, Stats } from "node:fs"; import { isStream } from "is-stream"; import readdirGlob from "readdir-glob"; import { Readable } from "lazystream"; @@ -7,7 +7,9 @@ import { dirname, relative as relativePath, resolve as resolvePath, -} from "path"; +} from "node:path"; +import process from "node:process"; +import { Buffer } from "node:buffer"; import { ArchiverError } from "./error.js"; import { Transform } from "readable-stream"; import { diff --git a/lib/plugins/tar.js b/lib/plugins/tar.js index 1a4e1d043..a90a201e9 100644 --- a/lib/plugins/tar.js +++ b/lib/plugins/tar.js @@ -1,4 +1,4 @@ -import zlib from "zlib"; +import zlib from "node:zlib"; import engine from "tar-stream"; import { collectStream } from "../utils.js"; diff --git a/lib/utils.js b/lib/utils.js index b8e7e1802..24e878120 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,3 +1,4 @@ +import { Buffer } from "node:buffer"; import normalizePath from "normalize-path"; import { PassThrough } from "readable-stream"; import { isStream } from "is-stream"; diff --git a/test/archiver.js b/test/archiver.js index 20de9ad19..2b13bd33c 100644 --- a/test/archiver.js +++ b/test/archiver.js @@ -7,7 +7,8 @@ import { symlinkSync, unlinkSync, writeFileSync, -} from "fs"; +} from "node:fs"; +import process from "node:process"; import { PassThrough } from "readable-stream"; import { Readable } from "readable-stream"; import { assert } from "chai"; diff --git a/test/helpers/index.js b/test/helpers/index.js index d4a7ebe96..4ac56b83a 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -1,7 +1,8 @@ -import crypto from "crypto"; -import { readFileSync, WriteStream } from "fs"; -import { inherits } from "util"; -import { Stream } from "stream"; +import crypto from "node:crypto"; +import { readFileSync, WriteStream } from "node:fs"; +import { inherits } from "node:util"; +import { Stream } from "node:stream"; +import { Buffer } from "node:buffer"; import { Readable, Writable } from "readable-stream"; export function adjustDateByOffset(d, offset) { diff --git a/test/plugins.js b/test/plugins.js index 494eb128e..fa94a0e48 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -5,7 +5,8 @@ import { unlinkSync, writeFileSync, WriteStream, -} from "fs"; +} from "node:fs"; +import process from "node:process"; import { assert } from "chai"; import { mkdirp } from "mkdirp"; import tar from "tar";