Skip to content

Commit

Permalink
Add watch and FSWatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Apr 24, 2024
1 parent d31f06a commit 0cd3df1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ console.log(await readFile("my/file"));
// -> My file content
```

Methods:

| Method | Deno | Node | Bun | Base implementation |
| ---------- | ---- | ---- | --- | ------------------- |
| appendFile | X | X | X | node:fs/promises |
Expand All @@ -87,6 +89,8 @@ console.log(await dirpath("config"));
// -> /home/user/.config
```

Methods:

| Method | Deno | Node | Bun | Base implementation |
| --------- | ---- | ---- | --- | ------------------- |
| unlink | X | X | X | node:fs/promises |
Expand All @@ -112,3 +116,9 @@ console.log(await dirpath("config"));
| open | X | X | X | node:fs/promises |
| access | X | X | X | node:fs/promises |
| constants | X | X | X | node:fs/promises |

Types:

| Method | Deno | Node | Bun | Base implementation |
| --------- | ---- | ---- | --- | ------------------- |
| FSWatcher | X | X | X | node:fs/promises |
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/fs",
"version": "0.0.9",
"version": "0.0.10",
"exports": {
".": "./mod.ts",
"./stat": "./src/stat/mod.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/ops/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ export {
rmdir,
truncate,
unlink,
watch,
} from "node:fs/promises";

export type {
FSWatcher
} from "node:fs";

export * from "./mktempdir.ts";
export * from "./tempfile.ts";
export * from "./chdir.ts";
Expand Down

0 comments on commit 0cd3df1

Please sign in to comment.