mirror of
https://github.com/denoland/deno.git
synced 2025-02-08 07:16:56 -05:00
Add sync method to filehandle method
This commit is contained in:
parent
6b7e4c331b
commit
43ac6b9573
2 changed files with 5 additions and 0 deletions
|
@ -148,6 +148,10 @@ export class FileHandle extends EventEmitter {
|
|||
stat(options: { bigint: true }): Promise<BigIntStats>;
|
||||
stat(options?: { bigint: boolean }): Promise<Stats | BigIntStats> {
|
||||
return fsCall(promises.fstat, this, options);
|
||||
};
|
||||
// readLines(options?):Promise<InterfaceConstructor>
|
||||
sync():Promise<void>{
|
||||
return Promise.resolve(promises.sync());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ Deno.test("[node/fs filehandle.write] Write from Buffer", async function () {
|
|||
|
||||
const buffer = Buffer.from("hello world");
|
||||
const res = await fileHandle.write(buffer, 0, 5, 0);
|
||||
await fileHandle.sync();
|
||||
|
||||
const data = Deno.readFileSync(tempFile);
|
||||
await Deno.remove(tempFile);
|
||||
|
|
Loading…
Add table
Reference in a new issue