write-file-safe

    1.3.1 • Public • Published

    write-file-safe

    NPM TypeScript Coverage Status GitHub Stars Twitter Follow

    Write files atomically and create parent directories if necessary.

    Installation

    yarn add write-file-safe
    npm install write-file-safe

    API

    import { writeFile, writeFileSync, Options } from "write-file-safe";
    
    function writeFile(path: string, content?: string | Buffer): Promise<boolean>;
    
    function writeFileSync(path: string, content?: string | Buffer): boolean;
    
    type Options = {
      /**
       * Recursively create parent directories if needed. Default: `true`
       */
      recursive?: boolean;
      /**
       * Ensure file ends with a newline. Default: `true`
       */
      appendNewline?: boolean;
    }

    Dependenciesdependencies


    Dev DependenciesDavid


    License license

    MIT

    Related Packages

    Install

    npm i write-file-safe

    DownloadsWeekly Downloads

    66

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    12.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar