Skip to content

feat(node_compat): Add a read method to the FileHandle class#19359

Merged
mmastrac merged 13 commits intodenoland:mainfrom
k-nasa:k-nasa/feat_read
Jun 8, 2023
Merged

feat(node_compat): Add a read method to the FileHandle class#19359
mmastrac merged 13 commits intodenoland:mainfrom
k-nasa:k-nasa/feat_read

Conversation

@k-nasa
Copy link
Copy Markdown
Contributor

@k-nasa k-nasa commented Jun 4, 2023

WHY

ref: #19165

The FileHandle class has many missing methods compared to node.

WHAT

  • Add read method


const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
const fs = await import("node:fs/promises");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const fs = await import("node:fs/promises");
import * as fs from "node:fs/promises";

Copy link
Copy Markdown
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just one small item!

@k-nasa k-nasa requested a review from mmastrac June 8, 2023 11:26
Copy link
Copy Markdown
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mmastrac mmastrac merged commit 262571e into denoland:main Jun 8, 2023
@k-nasa
Copy link
Copy Markdown
Contributor Author

k-nasa commented Jun 8, 2023

Thanks for review!

@k-nasa k-nasa deleted the k-nasa/feat_read branch June 8, 2023 13:01
bartlomieju pushed a commit that referenced this pull request Jun 8, 2023
ref: #19165

The FileHandle class has many missing methods compared to node.
@kt3k kt3k mentioned this pull request Sep 10, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants