@reliverse/relifso 1.2.7 โ 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/impl/copy.js +7 -1
- package/bin/mod.d.ts +3 -1
- package/bin/mod.js +4 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
- ๐งฏ Gracefully handles errors like `EMFILE` (reading or writing a lot of files at once) and other edge cases
|
|
13
13
|
- ๐ Consistent error-first behavior โ even for legacy APIs like `fs.exists()`
|
|
14
14
|
- ๐ฆ First-class ESM and full TypeScript support โ no config hacks required
|
|
15
|
-
- ๐งผ Zero bloat โ
|
|
15
|
+
- ๐งผ Zero bloat โ small size ([3.9 kB](https://bundlephobia.com/package/@reliverse/relifso@latest)), zero deps, modern code, no monkey-patching
|
|
16
16
|
- ๐ฏ Supports all Node.js v16+ features โ optimized for Node.js v22+
|
|
17
17
|
- ๐งช **Soon**: Ready for upcoming Node.js v22+ experimental features
|
|
18
18
|
- โ๏ธ **Soon**: Bun v1.2+ ready โ ships with Bun-aware enhancements out of the box
|
package/bin/impl/copy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { copyFileSync, statSync, constants as fsConstants } from "node:fs";
|
|
2
|
-
import { stat as statAsync, copyFile as copyFileAsync, constants as fsConstantsAsync } from "node:fs/promises";
|
|
2
|
+
import { stat as statAsync, copyFile as copyFileAsync, constants as fsConstantsAsync, readdir } from "node:fs/promises";
|
|
3
3
|
import { dirname, join as joinPath, basename as basenamePath } from "node:path";
|
|
4
4
|
import { mkdirsSync } from "./mkdirs.js";
|
|
5
5
|
import { mkdirs } from "./mkdirs.js";
|
|
@@ -55,6 +55,12 @@ export async function copy(src, dest, options = {}) {
|
|
|
55
55
|
await mkdirs(destDir);
|
|
56
56
|
if (srcStat?.isDirectory()) {
|
|
57
57
|
await mkdirs(destFinal);
|
|
58
|
+
const entries = await readdir(src);
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
const srcEntry = joinPath(src, entry);
|
|
61
|
+
const destEntry = joinPath(destFinal, entry);
|
|
62
|
+
await copy(srcEntry, destEntry, options);
|
|
63
|
+
}
|
|
58
64
|
} else {
|
|
59
65
|
await copyFileAsync(src, destFinal, preserveTimestamps ? fsConstantsAsync.COPYFILE_FICLONE : 0);
|
|
60
66
|
if (preserveTimestamps) {
|
package/bin/mod.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export type { ReadFileOptions } from "./impl/read-file.js";
|
|
|
77
77
|
export type { ReadJsonOptions } from "./impl/read-json.js";
|
|
78
78
|
export type { JsonStringifyOptions } from "./impl/write-json.js";
|
|
79
79
|
export type { WriteJsonOptions } from "./impl/write-json.js";
|
|
80
|
-
export { accessSync, appendFileSync, chmodSync, chownSync, closeSync, copyFileSync, createReadStream, createWriteStream, fchmodSync, fchownSync, fdatasyncSync, fstatSync, fsyncSync, ftruncateSync, futimesSync, lchmodSync, lchownSync, linkSync, lstatSync, lutimesSync, mkdtempSync, openSync, opendirSync, readFileSync, readlinkSync, readSync, readdirSync, realpathSync, nodeRenameSync, rmSync, rmdirSync, statSync, statfsSync, symlinkSync, truncateSync, nodeUnlinkSync, unwatchFile, utimesSync, watchFile, writeFileSync, writeSync, readvSync, writevSync, readJsonSync, writeJsonSync, createFileSync, mkdirsSync, emptyDirSync, pathExistsSync, copySync, moveSync, removeSync, outputJsonSync, outputFileSync, diveSync, cpSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, mkdirSync, ncpSync, outputJSONSync, readJSONSync, renameSync, rimrafSync, unlinkSync, writeJSONSync, isDirectorySync, isSymlinkSync, readLinesSync, readTextSync, readJson, writeJson, createFile, mkdirs, emptyDir, pathExists, copy, move, remove, outputJson, outputFile, access, appendFile, chmod, chown, copyFile, lchmod, lchown, link, lstat, lutimes, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, nodeRename, rm, rmdir, stat, statfs, symlink, truncate, nodeUnlink, utimes, watch, writeFile, constants, cp, ensureDir, ensureFile, exists, mkdir, mkdirp, ncp, outputJSON, readJSON, rename, resolve, rimraf, unlink, writeJSON, isDirectory, isSymlink, readLines, readText, };
|
|
80
|
+
export { accessSync, appendFileSync, chmodSync, chownSync, closeSync, copyFileSync, createReadStream, createWriteStream, fchmodSync, fchownSync, fdatasyncSync, fstatSync, fsyncSync, ftruncateSync, futimesSync, lchmodSync, lchownSync, linkSync, lstatSync, lutimesSync, mkdtempSync, openSync, opendirSync, readFileSync, readlinkSync, readSync, readdirSync, realpathSync, nodeRenameSync, rmSync, rmdirSync, statSync, statfsSync, symlinkSync, truncateSync, nodeUnlinkSync, unwatchFile, utimesSync, watchFile, writeFileSync, writeSync, readvSync, writevSync, readJsonSync, writeJsonSync, createFileSync, mkdirsSync, emptyDirSync, pathExistsSync, copySync, moveSync, removeSync, outputJsonSync, outputFileSync, diveSync, cpSync, ensureDirSync as ensuredirSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, mkdirSync, ncpSync, outputJSONSync, readJSONSync, renameSync, rimrafSync, unlinkSync, writeJSONSync, isDirectorySync, isSymlinkSync, readLinesSync, readTextSync, readJson, writeJson, createFile, mkdirs, emptyDir, pathExists, copy, move, remove, outputJson, outputFile, access, appendFile, chmod, chown, copyFile, lchmod, lchown, link, lstat, lutimes, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, nodeRename, rm, rmdir, stat, statfs, symlink, truncate, nodeUnlink, utimes, watch, writeFile, constants, cp, ensureDir as ensuredir, ensureDir, ensureFile, exists, mkdir, mkdirp, ncp, outputJSON, readJSON, rename, resolve, rimraf, unlink, writeJSON, isDirectory, isSymlink, readLines, readText, };
|
|
81
81
|
declare const fs: {
|
|
82
82
|
accessSync: typeof accessSync;
|
|
83
83
|
appendFileSync: typeof appendFileSync;
|
|
@@ -135,6 +135,7 @@ declare const fs: {
|
|
|
135
135
|
outputFileSync: typeof outputFileSync;
|
|
136
136
|
diveSync: typeof diveSync;
|
|
137
137
|
cpSync: typeof copySync;
|
|
138
|
+
ensuredirSync: typeof mkdirsSync;
|
|
138
139
|
ensureDirSync: typeof mkdirsSync;
|
|
139
140
|
ensureFileSync: typeof createFileSync;
|
|
140
141
|
existsSync: typeof pathExistsSync;
|
|
@@ -193,6 +194,7 @@ declare const fs: {
|
|
|
193
194
|
constants: typeof constants;
|
|
194
195
|
cp: typeof copy;
|
|
195
196
|
ensureDir: typeof mkdirs;
|
|
197
|
+
ensuredir: typeof mkdirs;
|
|
196
198
|
ensureFile: typeof createFile;
|
|
197
199
|
exists: typeof pathExists;
|
|
198
200
|
mkdir: typeof mkdirs;
|
package/bin/mod.js
CHANGED
|
@@ -309,6 +309,7 @@ export {
|
|
|
309
309
|
outputFileSync,
|
|
310
310
|
diveSync,
|
|
311
311
|
cpSync,
|
|
312
|
+
ensureDirSync as ensuredirSync,
|
|
312
313
|
ensureDirSync,
|
|
313
314
|
ensureFileSync,
|
|
314
315
|
existsSync,
|
|
@@ -366,6 +367,7 @@ export {
|
|
|
366
367
|
writeFile,
|
|
367
368
|
constants,
|
|
368
369
|
cp,
|
|
370
|
+
ensureDir as ensuredir,
|
|
369
371
|
ensureDir,
|
|
370
372
|
ensureFile,
|
|
371
373
|
exists,
|
|
@@ -443,6 +445,7 @@ const fs = {
|
|
|
443
445
|
diveSync,
|
|
444
446
|
// Sync aliases
|
|
445
447
|
cpSync,
|
|
448
|
+
ensuredirSync: ensureDirSync,
|
|
446
449
|
ensureDirSync,
|
|
447
450
|
ensureFileSync,
|
|
448
451
|
existsSync,
|
|
@@ -504,6 +507,7 @@ const fs = {
|
|
|
504
507
|
constants,
|
|
505
508
|
cp,
|
|
506
509
|
ensureDir,
|
|
510
|
+
ensuredir: ensureDir,
|
|
507
511
|
ensureFile,
|
|
508
512
|
exists,
|
|
509
513
|
mkdir,
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"name": "@reliverse/relifso",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.9",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"fs",
|
|
11
11
|
"file",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@cspotcode/source-map-support": "^0.8.1",
|
|
37
37
|
"@eslint/js": "^9.27.0",
|
|
38
38
|
"@reliverse/dler": "^1.3.6",
|
|
39
|
+
"@reliverse/pathkit": "^1.0.4",
|
|
39
40
|
"@rollup/plugin-alias": "^5.1.1",
|
|
40
41
|
"@rollup/plugin-babel": "^6.0.4",
|
|
41
42
|
"@rollup/plugin-commonjs": "^28.0.3",
|