{ "name": "fs-write-stream-atomic", "version": "1.0.4-fix", "description": "Like `fs.createWriteStream(...)`, but atomic.", "main": "index.js", "directories": { "test": "test" }, "dependencies": { "graceful-fs": "^4.1.2" }, "devDependencies": { "tap": "^1.2.0" }, "scripts": { "test": "tap test/*.js" }, "repository": { "type": "git", "url": "git+https://github.com/npm/fs-write-stream-atomic.git" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "license": "ISC", "bugs": { "url": "https://github.com/npm/fs-write-stream-atomic/issues" }, "homepage": "https://github.com/npm/fs-write-stream-atomic", "gitHead": "ac0f001d165564b3763da3252d5bff327c26aea9", "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", "readmeFilename": "README.md", "_id": "fs-write-stream-atomic@1.0.4-fix", "_shasum": "8613fd3b1f92405cbfb613b8ec2b35b2a336a1d4", "_from": "sheerun/fs-write-stream-atomic#v1.0.4-fix", "_resolved": "git://github.com/sheerun/fs-write-stream-atomic.git#ac0f001d165564b3763da3252d5bff327c26aea9" }