read-file-safe
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.10 • Public • Published

    Read files without try catch.

    • Returns string or Buffer if successful.
    • Returns undefined on error rather than throwing.

    Installation

    yarn add read-file-safe
    npm install read-file-safe

    API

    import { readFile, readFileSync } from "read-file-safe";
     
    readFile(pathstring) => Promise<string | undefined>;
     
    readFileSync(pathstring) => string | undefined;

    Dev DependenciesDavid


    License license

    MIT


    Related Packages

    Install

    npm i read-file-safe

    DownloadsWeekly Downloads

    796

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    8.96 kB

    Total Files

    7

    Last publish

    Collaborators

    • bconnorwhite