Skip to content

Commit

Permalink
feat: A more efficient way to read bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed May 16, 2024
1 parent ab0d0ec commit 9d8a855
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ export declare class OPFSDirWrap {
```ts
import { OPFSFileWrap } from './file';
/**
* Create a temporary file that will automatically be cleared to avoid occupying too much storage space. The temporary file name will be automatically generated and stored in a specific directory.
* Create a temporary file that will automatically be cleared to avoid occupying too much storage space.
* The temporary file name will be automatically generated and stored in a specific directory.
*/
export declare function tmpfile(): OPFSFileWrap;
```
2 changes: 1 addition & 1 deletion src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class OPFSFileWrap {
async stream() {
const reader = await this.createReader();

const readLen = 1024;
const readLen = 64 * 1024;
return new ReadableStream<Uint8Array>({
pull: async (ctrl) => {
const buf = await reader.read(readLen);
Expand Down

0 comments on commit 9d8a855

Please sign in to comment.