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 4350f48 commit cd7ccdeCopy full SHA for cd7ccde
1 file changed
implement-shell-tools/cat/cat.js
@@ -0,0 +1,12 @@
1
+import process from "node:process";
2
+import { promises as fs } from "node:fs";
3
+
4
+const argv = process.argv.slice(2);
5
+if (argv.length != 1) {
6
+ console.error(`Expected exactly 1 argument (a path) to be passed but got ${argv.length}.`);
7
+ process.exit(1);
8
+}
9
+const path = argv[0];
10
+const content = await fs.readFile(path, "utf-8");
11
12
+console.log(content);
0 commit comments