Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 27, 2024
1 parent f0962f5 commit f93946b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
bun_ci:
uses: cross-org/workflows/.github/workflows/bun-ci.yml@main
with:
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid/"
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid"
node_ci:
uses: cross-org/workflows/.github/workflows/node-ci.yml@main
with:
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid/"
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid"
test_target: "src/**/*.test.ts"
60 changes: 49 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,59 @@ will cover most scenarios, this library focuses on the file system operations.

**Note:** This is work in progress.

## Coverage
## Modules

### Stat

Example:

```
import { exists } from "@cross/fs/stat";
console.log(await exists("my/file"));
// -> true / false
```

Methods:

| 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

Example:

```
import { readFile } from "@cross/fs/io";
console.log(await readFile("my/file"));
// -> My file content
```

| Module | Method | Deno | Node | Bun | Browser (LocalStorage) |
| ------ | --------- | ---- | ---- | --- | ---------------------- |
| io | readFile | X | X | X | |
| io | writeFile | X | X | X | |

### Ops

Example:

```
import { mktempdir } from "@cross/fs/ops";
console.log(await mktempdir("my-prefix"));
// -> /tmp/my-prefix-7a8s78-as67d6as6-asd67a6sd-asdyda/
```

| 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 | |
| ops | mkdir | X | X | X | |
| ops | mktempdir | X | X | X | |
| ops | rmdir | X | X | X | |
| ------ | ---------- | ---- | ---- | --- | ---------------------- |

0 comments on commit f93946b

Please sign in to comment.