We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 407b010 commit 56cac6cCopy full SHA for 56cac6c
1 file changed
implement-shell-tools/cat/cat.js
@@ -0,0 +1,17 @@
1
+import process from "node:process"
2
+import {promises as fs} from "node:fs"
3
+
4
+const argv = process.argv.slice(2)
5
6
+if (argv.length != 1) {
7
+ console.error(
8
+ `Expected exactly 1 argument (a path) to be passed but got ${argv.length}.`
9
+ );
10
+ process.exit(1);
11
+}
12
13
+const path = argv[0]
14
15
16
+const content = await fs.readFile(path, "utf-8")
17
+console.log(content)
0 commit comments