@little-nebulae/node-fs 0.1.0 → 0.2.0
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/dist/index.d.mts +8 -0
- package/dist/index.mjs +18 -1
- package/package.json +25 -17
package/dist/index.d.mts
CHANGED
|
@@ -50,4 +50,12 @@ export declare function removeFsEntry({ path, recursive, force, retry }: {
|
|
|
50
50
|
export declare function resolveRealPath({ path }: {
|
|
51
51
|
path: string;
|
|
52
52
|
}): Promise<Result<string, UnexpectedError>>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/utils/generate-entry-name.d.ts
|
|
55
|
+
/** e.g. "2026-10-09" */
|
|
56
|
+
export declare function generateEntryNameFromDate(date?: Date): string;
|
|
57
|
+
/** e.g. "14-30-05" */
|
|
58
|
+
export declare function generateEntryNameFromTime(date?: Date): string;
|
|
59
|
+
/** e.g. "2026-10-09_14-30-05" */
|
|
60
|
+
export declare function generateEntryNameFromDateTime(date?: Date): string;
|
|
53
61
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -183,4 +183,21 @@ async function resolveRealPath({ path }) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
|
-
|
|
186
|
+
//#region src/utils/generate-entry-name.ts
|
|
187
|
+
function pad(n, len = 2) {
|
|
188
|
+
return String(n).padStart(len, "0");
|
|
189
|
+
}
|
|
190
|
+
/** e.g. "2026-10-09" */
|
|
191
|
+
function generateEntryNameFromDate(date = /* @__PURE__ */ new Date()) {
|
|
192
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
193
|
+
}
|
|
194
|
+
/** e.g. "14-30-05" */
|
|
195
|
+
function generateEntryNameFromTime(date = /* @__PURE__ */ new Date()) {
|
|
196
|
+
return `${pad(date.getHours())}-${pad(date.getMinutes())}-${pad(date.getSeconds())}`;
|
|
197
|
+
}
|
|
198
|
+
/** e.g. "2026-10-09_14-30-05" */
|
|
199
|
+
function generateEntryNameFromDateTime(date = /* @__PURE__ */ new Date()) {
|
|
200
|
+
return `${generateEntryNameFromDate(date)}_${generateEntryNameFromTime(date)}`;
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
export { DEFAULT_CHARACTER_ENCODING, generateEntryNameFromDate, generateEntryNameFromDateTime, generateEntryNameFromTime, makeDirectory, makeDirectoryRecursively, readDirectory, readTextFile, removeFsEntry, resolveRealPath, writeTextFile };
|
package/package.json
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@little-nebulae/node-fs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
8
|
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"exports": {
|
|
10
11
|
".": "./dist/index.mjs",
|
|
11
12
|
"./package.json": "./package.json"
|
|
12
13
|
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"tag": "latest"
|
|
17
|
+
},
|
|
13
18
|
"devDependencies": {
|
|
14
19
|
"@arethetypeswrong/core": "0.18.5",
|
|
15
|
-
"@little-nebulae/error": "1.
|
|
16
|
-
"@little-nebulae/result": "1.
|
|
17
|
-
"@little-nebulae/system-error": "2.0.
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"oxlint": "
|
|
22
|
-
"
|
|
23
|
-
"publint": "0.3.24",
|
|
20
|
+
"@little-nebulae/error": "1.3.0",
|
|
21
|
+
"@little-nebulae/result": "1.3.0",
|
|
22
|
+
"@little-nebulae/system-error": "2.0.1",
|
|
23
|
+
"@types/node": "26.6.4",
|
|
24
|
+
"oxfmt": "0.72.0",
|
|
25
|
+
"oxlint": "1.87.0",
|
|
26
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
27
|
+
"publint": "0.3.25",
|
|
24
28
|
"tsdown": "0.23.0",
|
|
25
|
-
"tsx": "4.23.
|
|
29
|
+
"tsx": "4.23.15",
|
|
30
|
+
"type-fest": "5.10.0",
|
|
26
31
|
"typescript": "7.0.2",
|
|
27
|
-
"vitest": "5.0.
|
|
32
|
+
"vitest": "5.0.3"
|
|
28
33
|
},
|
|
29
34
|
"peerDependencies": {
|
|
30
|
-
"@little-nebulae/error": "^1.
|
|
31
|
-
"@little-nebulae/result": "^1.
|
|
32
|
-
"@little-nebulae/system-error": "^
|
|
33
|
-
"
|
|
35
|
+
"@little-nebulae/error": "^1.3.0",
|
|
36
|
+
"@little-nebulae/result": "^1.3.0",
|
|
37
|
+
"@little-nebulae/system-error": "^2.0.1",
|
|
38
|
+
"type-fest": "^5.0.0"
|
|
34
39
|
},
|
|
35
40
|
"devEngines": {
|
|
36
41
|
"packageManager": {
|
|
37
42
|
"name": "pnpm",
|
|
38
|
-
"version": "12.
|
|
43
|
+
"version": "12.10.1",
|
|
39
44
|
"onFail": "warn"
|
|
40
45
|
}
|
|
41
46
|
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": "^24.0.0"
|
|
49
|
+
},
|
|
42
50
|
"scripts": {
|
|
43
51
|
"build": "tsdown",
|
|
44
52
|
"try": "tsx ./src/try.ts",
|