Skip to content

Commit

Permalink
Deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 7, 2024
1 parent 724a6d9 commit a2a0121
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 218 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/deno.yml

This file was deleted.

51 changes: 19 additions & 32 deletions README.md
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
```
5 changes: 5 additions & 0 deletions demo.ts
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);
7 changes: 2 additions & 5 deletions deno.json
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"
}
3 changes: 0 additions & 3 deletions examples/stat.ts

This file was deleted.

1 change: 0 additions & 1 deletion mod.ts

This file was deleted.

148 changes: 0 additions & 148 deletions stat/mod.ts

This file was deleted.

0 comments on commit a2a0121

Please sign in to comment.