Skip to content

Commit f929943

Browse files
committed
Create basic mycat.js
1 parent 407b010 commit f929943

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

implement-shell-tools/cat/myCat.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import fs from "node:fs";
2+
3+
const args = process.argv.slice(2);
4+
const files = args;
5+
6+
for (const filename of files) {
7+
const content = fs.readFileSync(filename, "utf-8");
8+
process.stdout.write(content);
9+
}

0 commit comments

Comments
 (0)