Skip to content

apaleslimghost/atomic-write-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atomic-write-stream

ever tried fs.createReadStream('a.txt').pipe(fs.createWriteStream('a.txt')) and ended up with an empty file? yeah, don't do that. use atomic-write-stream.

npm install atomic-write-stream

works by redirecting your writes to a unique temporary file then renameing it to the target

how do atomic-write-stream

var fs = require('fs')
  , atomicWriteStream = require('atomic-write-stream')

fs.createReadStream('a.txt').pipe(atomicWriteStream('a.txt', optionsWotGetPassedToFs))

cheers

inspired by atomic-write except streaming because what is this 2011?

MIT licence, © MMXIV mb

Releases

No releases published

Packages

No packages published