@dephub/write 1.0.0 → 1.0.1
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 +0 -1
- package/dist/cli.js +9 -9
- package/dist/package.json.js +1 -1
- package/package.json +16 -6
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://npmjs.org/package/@dephub/write)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
|
-
[](https://nodejs.org/)
|
|
8
7
|
|
|
9
8
|
---
|
|
10
9
|
|
package/dist/cli.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { cli as o } from "@dephub/cli";
|
|
3
|
-
import {
|
|
4
|
-
import { writeFile as
|
|
5
|
-
import { name as
|
|
6
|
-
o.name(
|
|
7
|
-
const [e, i] =
|
|
3
|
+
import { logger as n } from "@dephub/logger";
|
|
4
|
+
import { writeFile as s } from "./core/write.js";
|
|
5
|
+
import { name as a, version as d, description as c } from "./utils/pkg.js";
|
|
6
|
+
o.name(a.split("/")[1] ?? "write").version(d).description(c).argument("<filepath>", "Path where the file will be written").argument("[content]", "Content to write (if not provided, reads from stdin)").action(async ({ args: r }) => {
|
|
7
|
+
const [e, i] = r;
|
|
8
8
|
try {
|
|
9
9
|
let t = i;
|
|
10
|
-
i || (t = await
|
|
10
|
+
i || (t = await m(), t || (n.error("No content provided and stdin is empty"), process.exit(1))), await s(e, t), n.success(`Written to ${e}`);
|
|
11
11
|
} catch (t) {
|
|
12
|
-
|
|
12
|
+
n.error(`Failed to write to ${e}: ${t.message}`), process.exit(1);
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
const
|
|
15
|
+
const m = () => new Promise((r, e) => {
|
|
16
16
|
let i = "";
|
|
17
|
-
process.stdin.setEncoding("utf8"), process.stdin.on("data", (t) => i += t), process.stdin.on("end", () =>
|
|
17
|
+
process.stdin.setEncoding("utf8"), process.stdin.on("data", (t) => i += t), process.stdin.on("end", () => r(i.trim())), process.stdin.on("error", e), process.stdin.isTTY && setTimeout(() => r(""), 100);
|
|
18
18
|
});
|
|
19
19
|
await o.run();
|
package/dist/package.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = "@dephub/write", i = "1.0.
|
|
1
|
+
const t = "@dephub/write", i = "1.0.1", o = "File writing utility with automatic directory creation for Node.js", e = {
|
|
2
2
|
name: t,
|
|
3
3
|
version: i,
|
|
4
4
|
description: o
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dephub/write",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "File writing utility with automatic directory creation for Node.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,22 +34,32 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"license": "MIT",
|
|
37
|
-
"homepage": "https://github.com/
|
|
37
|
+
"homepage": "https://github.com/estarlincito/dephub-write#readme",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/
|
|
41
|
-
"directory": "packages/write"
|
|
40
|
+
"url": "https://github.com/estarlincito/dephub-write.git"
|
|
42
41
|
},
|
|
43
42
|
"bugs": {
|
|
44
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/estarlincito/dephub-write/issues"
|
|
45
44
|
},
|
|
46
45
|
"publishConfig": {
|
|
47
46
|
"access": "public"
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@dephub/
|
|
49
|
+
"@dephub/logger": "^1.1.0",
|
|
51
50
|
"@dephub/cli": "^1.0.0"
|
|
52
51
|
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@dephub/lint": "^1.0.0",
|
|
54
|
+
"@dephub/lint-ts": "^1.0.0",
|
|
55
|
+
"@dephub/glob": "^1.0.0",
|
|
56
|
+
"@dephub/path": "^1.0.0",
|
|
57
|
+
"@types/node": "^24.3.1",
|
|
58
|
+
"typescript": "^5.9.2",
|
|
59
|
+
"eslint": "^9.37.0",
|
|
60
|
+
"vite": "^7.1.4",
|
|
61
|
+
"vite-plugin-dts": "^4.5.4"
|
|
62
|
+
},
|
|
53
63
|
"scripts": {
|
|
54
64
|
"release": "pnpm publish",
|
|
55
65
|
"check-types": "tsc --noEmit --skipLibCheck",
|