Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisjiang committed Aug 13, 2024
1 parent 41bfb92 commit d3d7eb3
Show file tree
Hide file tree
Showing 83 changed files with 177 additions and 107 deletions.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
| [readDirSync](functions/readDirSync.md) | Sync version of `readDir`. |
| [readFile](functions/readFile.md) | Reads the content of a file at the specified path as a File. |
| [readFileSync](functions/readFileSync.md) | Sync version of `readFile`. |
| [readJsonFile](functions/readJsonFile.md) | Reads the content of a file at the specified path as a string and returns it as a JSON object. |
| [readJsonFileSync](functions/readJsonFileSync.md) | Sync version of `readJsonFile`. |
| [readTextFile](functions/readTextFile.md) | Reads the content of a file at the specified path as a string. |
| [readTextFileSync](functions/readTextFileSync.md) | Sync version of `readTextFile`. |
| [remove](functions/remove.md) | Removes a file or directory at the specified path same as `rm -rf`. |
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/appendFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the content was

## Defined in

[fs/opfs\_ext.ts:120](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L120)
[fs/opfs\_ext.ts:120](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L120)
2 changes: 1 addition & 1 deletion docs/functions/appendFileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Sync version of `appendFile`.

## Defined in

[worker/opfs\_worker\_adapter.ts:186](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L186)
[worker/opfs\_worker\_adapter.ts:186](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L186)
2 changes: 1 addition & 1 deletion docs/functions/assertAbsolutePath.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Will throw an error if the path is not an absolute path.

## Defined in

[fs/assertions.ts:10](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/assertions.ts#L10)
[fs/assertions.ts:10](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/assertions.ts#L10)
2 changes: 1 addition & 1 deletion docs/functions/assertFileUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Will throw an error if the URL is not a valid file URL.

## Defined in

[fs/assertions.ts:21](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/assertions.ts#L21)
[fs/assertions.ts:21](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/assertions.ts#L21)
2 changes: 1 addition & 1 deletion docs/functions/connectSyncAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Communicate with worker.

## Defined in

[worker/opfs\_worker\_adapter.ts:17](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L17)
[worker/opfs\_worker\_adapter.ts:17](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L17)
2 changes: 1 addition & 1 deletion docs/functions/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ A promise that resolves to an `AsyncVoidIOResult` indicating whether the file wa

## Defined in

[fs/opfs\_ext.ts:136](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L136)
[fs/opfs\_ext.ts:136](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L136)
2 changes: 1 addition & 1 deletion docs/functions/copySync.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Sync version of `copy`.

## Defined in

[worker/opfs\_worker\_adapter.ts:193](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L193)
[worker/opfs\_worker\_adapter.ts:193](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L193)
2 changes: 1 addition & 1 deletion docs/functions/createFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the file was su

## Defined in

[fs/opfs\_core.ts:15](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L15)
[fs/opfs\_core.ts:15](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L15)
2 changes: 1 addition & 1 deletion docs/functions/createFileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `createFile`.

## Defined in

[worker/opfs\_worker\_adapter.ts:90](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L90)
[worker/opfs\_worker\_adapter.ts:90](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L90)
2 changes: 1 addition & 1 deletion docs/functions/deleteTemp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ A promise that resolves to an `AsyncVoidIOResult` indicating whether the tempora

## Defined in

[fs/opfs\_tmp.ts:29](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_tmp.ts#L29)
[fs/opfs\_tmp.ts:29](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_tmp.ts#L29)
2 changes: 1 addition & 1 deletion docs/functions/deleteTempSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Sync version of `deleteTemp`.

## Defined in

[worker/opfs\_worker\_adapter.ts:214](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L214)
[worker/opfs\_worker\_adapter.ts:214](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L214)
4 changes: 2 additions & 2 deletions docs/functions/downloadFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A task that can be aborted and contains the result of the download.

### Defined in

[fs/opfs\_download.ts:18](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_download.ts#L18)
[fs/opfs\_download.ts:18](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_download.ts#L18)

## downloadFile(fileUrl, filePath, requestInit)

Expand Down Expand Up @@ -59,4 +59,4 @@ A task that can be aborted and contains the result of the download.

### Defined in

[fs/opfs\_download.ts:27](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_download.ts#L27)
[fs/opfs\_download.ts:27](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_download.ts#L27)
2 changes: 1 addition & 1 deletion docs/functions/emptyDir.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the directory w

## Defined in

[fs/opfs\_ext.ts:152](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L152)
[fs/opfs\_ext.ts:152](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L152)
2 changes: 1 addition & 1 deletion docs/functions/emptyDirSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `emptyDir`.

## Defined in

[worker/opfs\_worker\_adapter.ts:200](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L200)
[worker/opfs\_worker\_adapter.ts:200](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L200)
2 changes: 1 addition & 1 deletion docs/functions/exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the file or dir

## Defined in

[fs/opfs\_ext.ts:176](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L176)
[fs/opfs\_ext.ts:176](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L176)
2 changes: 1 addition & 1 deletion docs/functions/existsSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Sync version of `exists`.

## Defined in

[worker/opfs\_worker\_adapter.ts:207](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L207)
[worker/opfs\_worker\_adapter.ts:207](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L207)
2 changes: 1 addition & 1 deletion docs/functions/generateTempPath.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ The temporary path.

## Defined in

[fs/utils.ts:11](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L11)
[fs/utils.ts:11](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L11)
2 changes: 1 addition & 1 deletion docs/functions/getFileDataByHandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to the data of the file.

## Defined in

[fs/utils.ts:97](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L97)
[fs/utils.ts:97](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L97)
2 changes: 1 addition & 1 deletion docs/functions/isDirectoryHandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Whether the handle is a directory.

## Defined in

[fs/utils.ts:79](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L79)
[fs/utils.ts:79](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L79)
2 changes: 1 addition & 1 deletion docs/functions/isFileHandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Whether the handle is a file.

## Defined in

[fs/utils.ts:70](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L70)
[fs/utils.ts:70](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L70)
2 changes: 1 addition & 1 deletion docs/functions/isFileHandleLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Whether the handle is a file-like.

## Defined in

[fs/utils.ts:88](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L88)
[fs/utils.ts:88](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L88)
2 changes: 1 addition & 1 deletion docs/functions/isOPFSSupported.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ A boolean indicating whether OPFS is supported.

## Defined in

[fs/support.ts:6](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/support.ts#L6)
[fs/support.ts:6](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/support.ts#L6)
2 changes: 1 addition & 1 deletion docs/functions/isTempPath.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Check whether the path is a temporary path.

## Defined in

[fs/utils.ts:30](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/utils.ts#L30)
[fs/utils.ts:30](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/utils.ts#L30)
2 changes: 1 addition & 1 deletion docs/functions/mkTemp.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves the result of the temporary file or directory path.

## Defined in

[fs/opfs\_tmp.ts:14](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_tmp.ts#L14)
[fs/opfs\_tmp.ts:14](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_tmp.ts#L14)
2 changes: 1 addition & 1 deletion docs/functions/mkTempSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `mkTemp`.

## Defined in

[worker/opfs\_worker\_adapter.ts:221](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L221)
[worker/opfs\_worker\_adapter.ts:221](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L221)
2 changes: 1 addition & 1 deletion docs/functions/mkdir.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the directory w

## Defined in

[fs/opfs\_core.ts:31](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L31)
[fs/opfs\_core.ts:31](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L31)
2 changes: 1 addition & 1 deletion docs/functions/mkdirSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `mkdir`.

## Defined in

[worker/opfs\_worker\_adapter.ts:97](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L97)
[worker/opfs\_worker\_adapter.ts:97](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L97)
2 changes: 1 addition & 1 deletion docs/functions/move.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the file or dir

## Defined in

[fs/opfs\_ext.ts:202](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L202)
[fs/opfs\_ext.ts:202](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L202)
2 changes: 1 addition & 1 deletion docs/functions/moveSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Sync version of `move`.

## Defined in

[worker/opfs\_worker\_adapter.ts:104](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L104)
[worker/opfs\_worker\_adapter.ts:104](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L104)
2 changes: 1 addition & 1 deletion docs/functions/pruneTemp.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncVoidIOResult` indicating whether the tempora

## Defined in

[fs/opfs\_tmp.ts:38](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_tmp.ts#L38)
[fs/opfs\_tmp.ts:38](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_tmp.ts#L38)
2 changes: 1 addition & 1 deletion docs/functions/pruneTempSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `pruneTemp`.

## Defined in

[worker/opfs\_worker\_adapter.ts:228](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L228)
[worker/opfs\_worker\_adapter.ts:228](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L228)
2 changes: 1 addition & 1 deletion docs/functions/readBlobFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` containing the file content as a F

## Defined in

[fs/opfs\_ext.ts:219](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L219)
[fs/opfs\_ext.ts:219](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L219)
2 changes: 1 addition & 1 deletion docs/functions/readBlobFileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `readBlobFile`.

## Defined in

[worker/opfs\_worker\_adapter.ts:235](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L235)
[worker/opfs\_worker\_adapter.ts:235](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L235)
2 changes: 1 addition & 1 deletion docs/functions/readDir.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ A promise that resolves to an `AsyncIOResult` containing an async iterable itera

## Defined in

[fs/opfs\_core.ts:48](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L48)
[fs/opfs\_core.ts:48](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L48)
2 changes: 1 addition & 1 deletion docs/functions/readDirSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Sync version of `readDir`.

## Defined in

[worker/opfs\_worker\_adapter.ts:111](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L111)
[worker/opfs\_worker\_adapter.ts:111](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L111)
6 changes: 3 additions & 3 deletions docs/functions/readFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Optional read options.

### Defined in

[fs/opfs\_core.ts:80](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L80)
[fs/opfs\_core.ts:80](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L80)

## readFile(filePath, options)

Expand Down Expand Up @@ -96,7 +96,7 @@ Optional read options.

### Defined in

[fs/opfs\_core.ts:91](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L91)
[fs/opfs\_core.ts:91](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L91)

## readFile(filePath, options)

Expand Down Expand Up @@ -135,4 +135,4 @@ Optional read options.

### Defined in

[fs/opfs\_core.ts:102](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L102)
[fs/opfs\_core.ts:102](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L102)
6 changes: 3 additions & 3 deletions docs/functions/readFileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Sync version of `readFile`.

### Defined in

[worker/opfs\_worker\_adapter.ts:118](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L118)
[worker/opfs\_worker\_adapter.ts:118](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L118)

## readFileSync(filePath, options)

Expand All @@ -48,7 +48,7 @@ function readFileSync(filePath, options): IOResult<string>

### Defined in

[worker/opfs\_worker\_adapter.ts:121](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L121)
[worker/opfs\_worker\_adapter.ts:121](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L121)

## readFileSync(filePath, options)

Expand All @@ -69,4 +69,4 @@ function readFileSync(filePath, options?): IOResult<ArrayBuffer>

### Defined in

[worker/opfs\_worker\_adapter.ts:124](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L124)
[worker/opfs\_worker\_adapter.ts:124](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L124)
35 changes: 35 additions & 0 deletions docs/functions/readJsonFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[**happy-opfs**](../README.md)**Docs**

***

[happy-opfs](../README.md) / readJsonFile

# Function: readJsonFile()

```ts
function readJsonFile<T>(filePath): AsyncIOResult<T>
```

Reads the content of a file at the specified path as a string and returns it as a JSON object.

## Type Parameters

| Type Parameter |
| ------ |
| `T` |

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `filePath` | `string` | The path of the file to read. |

## Returns

`AsyncIOResult`\<`T`\>

A promise that resolves to an `AsyncIOResult` containing the file content as a JSON object.

## Defined in

[fs/opfs\_ext.ts:231](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L231)
33 changes: 33 additions & 0 deletions docs/functions/readJsonFileSync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[**happy-opfs**](../README.md)**Docs**

***

[happy-opfs](../README.md) / readJsonFileSync

# Function: readJsonFileSync()

```ts
function readJsonFileSync<T>(filePath): IOResult<T>
```

Sync version of `readJsonFile`.

## Type Parameters

| Type Parameter |
| ------ |
| `T` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `filePath` | `string` |

## Returns

`IOResult`\<`T`\>

## Defined in

[worker/opfs\_worker\_adapter.ts:244](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L244)
2 changes: 1 addition & 1 deletion docs/functions/readTextFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` containing the file content as a s

## Defined in

[fs/opfs\_ext.ts:231](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_ext.ts#L231)
[fs/opfs\_ext.ts:247](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_ext.ts#L247)
2 changes: 1 addition & 1 deletion docs/functions/readTextFileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `readTextFile`.

## Defined in

[worker/opfs\_worker\_adapter.ts:244](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L244)
[worker/opfs\_worker\_adapter.ts:257](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L257)
2 changes: 1 addition & 1 deletion docs/functions/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` indicating whether the file or dir

## Defined in

[fs/opfs\_core.ts:143](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L143)
[fs/opfs\_core.ts:143](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L143)
2 changes: 1 addition & 1 deletion docs/functions/removeSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Sync version of `remove`.

## Defined in

[worker/opfs\_worker\_adapter.ts:152](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker_adapter.ts#L152)
[worker/opfs\_worker\_adapter.ts:152](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker_adapter.ts#L152)
2 changes: 1 addition & 1 deletion docs/functions/startSyncAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Start runner loop.

## Defined in

[worker/opfs\_worker.ts:45](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/worker/opfs_worker.ts#L45)
[worker/opfs\_worker.ts:45](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/worker/opfs_worker.ts#L45)
2 changes: 1 addition & 1 deletion docs/functions/stat.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ A promise that resolves to an `AsyncIOResult` containing the `FileSystemHandle`.

## Defined in

[fs/opfs\_core.ts:182](https://github.com/JiangJie/happy-opfs/blob/1fc39add615fcd3c1ee38b13edeb0d38cd3481c4/src/fs/opfs_core.ts#L182)
[fs/opfs\_core.ts:182](https://github.com/JiangJie/happy-opfs/blob/41bfb9280ee562c4a8708809308f96d116edb112/src/fs/opfs_core.ts#L182)
Loading

0 comments on commit d3d7eb3

Please sign in to comment.