fs/promises#FileHandle TypeScript Examples

The following examples show how to use fs/promises#FileHandle. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: file.ts    From arbundles with Apache License 2.0 5 votes vote down vote up
fileToFd = async (f: File): Promise<FileHandle> =>
  typeof f === "string" ? await fs.promises.open(f, "r") : f
Example #2
Source File: process.ts    From diablo2 with MIT License 5 votes vote down vote up
fh: Promise<FileHandle> | null;
Example #3
Source File: mpq.ts    From diablo2 with MIT License 5 votes vote down vote up
_fd: Promise<FileHandle>;
Example #4
Source File: index.ts    From quickchart-js with MIT License 5 votes vote down vote up
async toFile(pathOrDescriptor: PathLike | FileHandle): Promise<void> {
    const fs = require('fs');
    const buf = await this.toBinary();
    fs.writeFileSync(pathOrDescriptor, buf);
  }