-
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
7 changed files
with
26 additions
and
218 deletions.
There are no files selected for viewing
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,51 +1,38 @@ | ||
# @cross/fs | ||
|
||
**Work in progress** Cross Runtime filesystem operations for JavaScript and | ||
TypeScript. | ||
**This is deprecated** | ||
|
||
Available for Node, Deno Bun and Browser at | ||
[jsr.io/@cross/fs](https://jsr.io/@cross/fs), works seamlessly with both | ||
JavaScript and TypeScript. | ||
We started working on this library just to realise that there is already a fs | ||
module supporting all runtimes, built into all runtimes - `node:fs/promises`. | ||
|
||
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. | ||
If you want to work with paths, there is `@std/path`. | ||
|
||
## Coverage | ||
Here's how to use it, using stat as an example: | ||
|
||
| Method | Deno | Node | Bun | Browser (LocalStorage) | | ||
| ------ | ---- | ---- | --- | ---------------------- | | ||
| stat | X | X | X | | | ||
| ... | | | | | | ||
```js | ||
import { stat } from "node:fs/promises"; | ||
|
||
## Contribution guide | ||
const stats = await stat("mod.ts"); | ||
|
||
## Deno | ||
|
||
```bash | ||
# Run an example using Deno | ||
deno run -A examples/stat.ts | ||
console.log(stats); | ||
``` | ||
|
||
## Bun | ||
Run using | ||
|
||
## Deno: | ||
|
||
```bash | ||
# Install deps locally | ||
bun jsr add @cross/runtime | ||
deno run --allow-read demo.ts | ||
``` | ||
|
||
## Node: | ||
|
||
```bash | ||
# Run an example using Bun | ||
bun run examples/stat.ts | ||
npx tsx demo.ts | ||
``` | ||
|
||
## Node | ||
|
||
````bash | ||
# Install deps locally | ||
npx jsr add @cross/runtime | ||
`` | ||
## Bun: | ||
|
||
```bash | ||
# Run an example using tsx in Node | ||
npx tsx examples/stat.ts | ||
```` | ||
bun run demo.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,5 @@ | ||
import { stat } from "node:fs/promises"; | ||
|
||
const stats = await stat("./demo.ts"); | ||
|
||
console.log(stats); |
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,8 +1,5 @@ | ||
{ | ||
"name": "@cross/fs", | ||
"version": "0.0.1", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"@cross/runtime": "jsr:@cross/runtime@^0.0.16" | ||
} | ||
"version": "0.0.2", | ||
"exports": "./demo.ts" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.