-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
40 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,26 @@ | ||
# @cross/fs | ||
|
||
**Work in progress** Cross Runtime filesystem operations for JavaScript and | ||
TypeScript. | ||
A cross-runtime utility library collecting best practices around filesystem | ||
operations for JavaScript and TypeScript. Available for Node, Deno Bun and | ||
Browser at [jsr.io/@cross/fs](https://jsr.io/@cross/fs). | ||
|
||
Available for Node, Deno Bun and Browser at | ||
[jsr.io/@cross/fs](https://jsr.io/@cross/fs), works seamlessly with both | ||
JavaScript and TypeScript. | ||
|
||
For cross rutime path operations, [jsr.io/@std/path](https://jsr.io/@std/path) | ||
For cross rutime _path_ operations, [jsr.io/@std/path](https://jsr.io/@std/path) | ||
will cover most scenarios, this library focuses on the file system operations. | ||
|
||
## Coverage | ||
|
||
| Method | Deno | Node | Bun | Browser (LocalStorage) | | ||
| --------- | ---- | ---- | --- | ---------------------- | | ||
| stat | X | X | X | | | ||
| exists | X | X | X | | | ||
| isDir | X | X | X | | | ||
| isFile | X | X | X | | | ||
| isSymlink | X | X | X | | | ||
| ... | | | | | | ||
|
||
## Contribution guide | ||
|
||
## Deno | ||
|
||
```bash | ||
# Run an example using Deno | ||
deno run -A examples/stat.ts | ||
``` | ||
**Note:** This is work in progress. | ||
|
||
## Bun | ||
|
||
```bash | ||
# Install deps locally | ||
bun jsr add @cross/runtime | ||
``` | ||
|
||
```bash | ||
# Run an example using Bun | ||
bun run examples/stat.ts | ||
``` | ||
|
||
## Node | ||
|
||
````bash | ||
# Install deps locally | ||
npx jsr add @cross/runtime | ||
`` | ||
## Coverage | ||
|
||
```bash | ||
# Run an example using tsx in Node | ||
npx tsx examples/stat.ts | ||
```` | ||
| Module | Method | Deno | Node | Bun | Browser (LocalStorage) | | ||
| ------ | ---------- | ---- | ---- | --- | ---------------------- | | ||
| stat | stat | X | X | X | | | ||
| stat | exists | X | X | X | | | ||
| stat | isDir | X | X | X | | | ||
| stat | isFile | X | X | X | | | ||
| stat | isSymlink | X | X | X | | | ||
| ------ | ---------- | ---- | ---- | --- | ---------------------- | | ||
| io | readFile | X | X | X | | | ||
| io | writeFile | X | X | X | | | ||
| ------ | ---------- | ---- | ---- | --- | ---------------------- | | ||
| ops | unlink | X | X | X | | | ||
| ------ | ---------- | ---- | ---- | --- | ---------------------- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { stat } from "./src/stat.ts"; | ||
export { exists } from "./src/exists.ts"; | ||
export * from "./src/stat/mod.ts"; | ||
export * from "./src/io/mod.ts"; | ||
export * from "./src/ops/mod.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./read.ts"; | ||
export * from "./write.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { readFile } from "node:fs/promises"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { writeFile } from "node:fs/promises"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./unlink.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { unlink } from "node:fs/promises"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters