fast-write-atomic

    0.2.1 • Public • Published

    fast-write-atomic

    BuildStatus

    Fast way to write a file atomically, for Node.js

    Status: experimental

    Install

    npm i fast-write-atomic
    

    Example

    const writeFile = require('fast-write-atomic')
     
    const data = Buffer.from('hello world')
     
    writeFile('./hello', data, function (err) {
      if (err) {
        console.log(err)
        return
      }
     
      console.log('file written')
    })

    Benchmarks

    Those benchmarks writes a 1 MB file a thousand times:

    benchWriteFileAtomic*1000: 9830.501ms
    benchFastWriteAtomic*1000: 8848.916ms
    benchWriteFileAtomic*1000: 9944.722ms
    benchFastWriteAtomic*1000: 8997.108ms
    

    License

    MIT

    Install

    npm i fast-write-atomic

    DownloadsWeekly Downloads

    79,900

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    12.4 kB

    Total Files

    8

    Last publish

    Collaborators

    • matteo.collina