Need help with write-files-atomic?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jamiebuilds
126 Stars 4 Forks MIT License 6 Commits 0 Opened issues

Description

Write many files atomically

Services available

!
?

Need anything else?

Contributors list

# 1,101
React
JavaScr...
Babel
babel-p...
6 commits

write-files-atomic

Write many files atomically

  • Creates temporary files with file contents
  • Moves them all at once using
    rename()
  • Automatically cleans up after itself
  • Optimized to be as fast as possible
  • Doesn't break file watchers
  • Doesn't swallow errors
  • Includes Flow types

Install

yarn add write-files-atomic

Usage

const writeFilesAtomic = require('write-files-atomic');

await writeFilesAtomic([ { filePath: './foo.txt', fileContents: '...foo...' }, { filePath: './bar.txt', fileContents: '...bar...' }, { filePath: './baz.txt', fileContents: '...baz...' }, ]);

API

type Files = Array;

declare function writeFilesAtomic(files: Files): Promise;

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.