@types/fs-readfile-promise
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

Installation

npm install --save @types/fs-readfile-promise

Summary

This package contains type definitions for fs-readfile-promise (https://github.com/shinnn/fs-readfile-promise).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-readfile-promise.

index.d.ts

/// <reference types="node" />
import { PathLike } from "fs";
type PathType = PathLike | number;
type OptionsType = { encoding: string; flag?: string | undefined } | string;

export = fsReadFilePromise;

/**
 * Asynchronously reads the entire contents of a file.
 * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
 * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
 * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
 * If a flag is not provided, it defaults to `'r'`.
 */
declare function fsReadFilePromise(path: PathType, options: OptionsType): Promise<string>;

/**
 * Asynchronously reads the entire contents of a file.
 * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
 * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
 */
declare function fsReadFilePromise(path: PathType, options?: null): Promise<Buffer>;

declare namespace fsReadFilePromise {}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Motosugi Murata.

Versions

Current Tags

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.4
    294
  • 3.0.3
    1
  • 3.0.2
    17
  • 3.0.1
    40
  • 3.0.0
    28

Package Sidebar

Install

npm i @types/fs-readfile-promise

Weekly Downloads

380

Version

3.0.4

License

MIT

Unpacked Size

4.85 kB

Total Files

5

Last publish

Collaborators

  • types