Skip to content

Commit

Permalink
Skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 7, 2024
1 parent 4035cd2 commit 03c300c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# fs
Cross Runtime (Deno, Node, Bun) filesystem operations for JavaScript and TypeScript
# @cross/fs

Available for Node, Deno Bun and Browser at [jsr.io/@cross/fs](https://jsr.io/@cross/fs).

**Work in progress** Cross Runtime filesystem operations for JavaScript and TypeScript.

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) |
|--------|------|------|-----|-------- |
| access | X | X | X | |
| readfile | X | X | X | |
| writefile | X | X | X | |
| ... | | | | |
18 changes: 18 additions & 0 deletions access/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CurrentRuntime, Runtime } from "@cross/runtime";

// Defailt to failure
// deno-lint-ignore prefer-const
let access = () => { throw new Error("Unsupported Runtime") };

switch (CurrentRuntime) {
case Runtime.Node:
break;
case Runtime.Deno:
break;
case Runtime.Bun:
break;
case Runtime.Browser:
break;
}

export { access };
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "imports": { "@cross/runtime": "jsr:@cross/runtime@^0.0.16" } }
19 changes: 19 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { access } from "./access/mod.ts";

0 comments on commit 03c300c

Please sign in to comment.