{"name":"fs-write-stream-atomic","version":"1.0.1","author":{"url":"http://blog.izs.me/","name":"Isaac Z. Schlueter","email":"i@izs.me"},"license":"ISC","_id":"fs-write-stream-atomic@1.0.1","maintainers":[{"name":"isaacs","email":"i@izs.me"}],"homepage":"https://github.com/npm/fs-write-stream-atomic","bugs":{"url":"https://github.com/npm/fs-write-stream-atomic/issues"},"dist":{"shasum":"5e424a143d9d29a700bb409729d6612b678f05ac","tarball":"http://registry-npm.ywwl.com/fs-write-stream-atomic/download/fs-write-stream-atomic-1.0.1.tgz","integrity":"sha512-d4Ab+nI+EouJVhn+ayTofifO0s3C5sRQJPQ/gsCU2Jj1Kwa1NjE/6DkG93Hmyvrr2ERQtIrOZLX62EQjDO70pA==","signatures":[{"sig":"MEUCICHTzwEI9o23P2+p4yRWK7O5LOVIKyyWxOaFzkdYDhgwAiEAl876BR8BTHZkV3/tGLT4NQWePdzjEpUv/8jgJEgfiy0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":3061,"noattachment":false,"key":"/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.1.tgz"},"main":"index.js","_from":".","_shasum":"5e424a143d9d29a700bb409729d6612b678f05ac","gitHead":"7db0e8159270278b097789bcefb061b5c5fa7161","scripts":{"test":"tap test/*.js"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"deprecated":"This package is no longer supported.","repository":{"url":"https://github.com/npm/fs-write-stream-atomic","type":"git"},"_npmVersion":"2.0.2","description":"Like `fs.createWriteStream(...)`, but atomic.","directories":{"test":"test"},"_nodeVersion":"0.10.31","dependencies":{"graceful-fs":"^3.0.2"},"devDependencies":{"tap":"^0.4.12"},"readme":"# fs-write-stream-atomic\n\nLike `fs.createWriteStream(...)`, but atomic.\n\nWrites to a tmp file and does an atomic `fs.rename` to move it into\nplace when it's done.\n\nFirst rule of debugging: **It's always a race condition.**\n\n## USAGE\n\n```javascript\nvar fsWriteStreamAtomic = require('fs-write-stream-atomic')\n// options are optional.\nvar write = fsWriteStreamAtomic('output.txt', options)\nvar read = fs.createReadStream('input.txt')\nread.pipe(write)\n\n// When the write stream emits a 'finish' or 'close' event,\n// you can be sure that it is moved into place, and contains\n// all the bytes that were written to it, even if something else\n// was writing to `output.txt` at the same time.\n```\n\n### `fsWriteStreamAtomic(filename, [options])`\n\n* `filename` {String} The file we want to write to\n* `options` {Object}\n  * `chown` {Object} User and group to set ownership after write\n    * `uid` {Number}\n    * `gid` {Number}\n  * `encoding` {String} default = 'utf8'\n  * `mode` {Number} default = `0666`\n  * `flags` {String} default = `'w'`\n\n","publish_time":1411424821540,"_cnpm_publish_time":1411424821540,"dist-tags":{"latest":"1.0.10"}}