{"name":"@parcel/fs-write-stream-atomic","version":"2.0.2-nightly.2585","description":"Like `fs.createWriteStream(...)`, but atomic.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/parcel-bundler/parcel.git","directory":"packages/utils/fs-write-stream-atomic"},"directories":{"test":"test"},"funding":{"type":"opencollective","url":"https://opencollective.com/parcel"},"publishConfig":{"access":"public"},"dependencies":{"graceful-fs":"^4.1.2","iferr":"^1.0.2","imurmurhash":"^0.1.4","readable-stream":"1 || 2"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","gitHead":"695660000f2f25ed17398176a78b85e5a8c3ccd6","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","readmeFilename":"README.md","bugs":{"url":"https://github.com/parcel-bundler/parcel/issues"},"homepage":"https://github.com/parcel-bundler/parcel#readme","_id":"@parcel/fs-write-stream-atomic@2.0.2-nightly.2585","_nodeVersion":"16.13.1","_npmVersion":"lerna/3.20.2/node@v16.13.1+x64 (linux)","dist":{"integrity":"sha512-YzH5V2moroab5ry8POMezsDVn1SvvFiLZVh1Ba4yVJIpYBDhy9xPuTW/VS6eS+KYenCHWxkVD4PhDRL2J5jY/w==","shasum":"06e713b3a5bf445d69ae7cfc23e61cac78ae2e22","tarball":"http://registry-npm.ywwl.com/@parcel/fs-write-stream-atomic/download/@parcel/fs-write-stream-atomic-2.0.2-nightly.2585.tgz","fileCount":14,"unpackedSize":20263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0kW5CRA9TVsSAnZWagAAq3UQAJhp+IfgZlU7xqAjzwMb\nJvHTdLuvCYaRGLXVOWq4C2KlnZh/Jq88eLd8FeCVtOZf3sbzIWsKdhclZjAe\nsalR5UOMnxfTAJF4G0IqI5RrikThd2eeTEvbh5AUBhyMMaaf2b33L2Gcnj6T\nEtHqUkEviqMbNnUph1rrzYC9tx3tf4FLDyAtmFrq4PgREMuZSHJVvq2Y9dCz\nVOgClwImK+7f5O+SMoVhulvsmhnBob8lTrFiiB2dlzVwcA+Up1Cvjoj0K9vM\naOcNv9U+s60GLzntLmQ0d3P4HLtVmTPFB5zuUSpvELYvTrdpA7n6FEyv0bza\nxJ+QKY8HdjxjYvlmmEIUEQ0PCfQDVu+lqQq75nMojZxYTmX/51H8VtIb5CQd\n/OutmPEFtW6V9kObQ0g4qtnandJzcpxX0asJ8EveH+ndt3fqfl7Z1nIGJrFX\nNjEJcuxQNP1HNa8kEOltl3jTmGKMbaEi2LsBF+65N2vM+KDerxOWloCi/B7o\n3oh11PWieRHgGqPQi6RIQofvR7s7TWJ0v/s3ffhxEK8RWtX4v9wYIJZZn/bO\nzHFHS71riuBlM7XYXWHwbvBKfBeNKU9ulyoS7DpIZcKfc+uP9hn7sTsDHVkf\n98GlUYzAByCGbTn412SDrGcOHq1DgEn80FuGM6a7ov6yveGhsnE0dStmvUYM\n1lmv\r\n=k37n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGcErAbPJGsDr59dIBpdCo8i5AiDDNXxzGi2Mu2ezHknAiEAgeh6IZddoh9HJ/B+1HNEZflwM596zMv0EdQUa1KAB1c="}],"size":6078,"noattachment":false,"key":"/@parcel/fs-write-stream-atomic/-/@parcel/fs-write-stream-atomic-2.0.2-nightly.2585.tgz"},"_npmUser":{"name":"devongovett","email":"devongovett@gmail.com"},"maintainers":[{"name":"devongovett","email":"devongovett@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-write-stream-atomic_2.0.2-nightly.2585_1641170360979_0.8278385639900374"},"_hasShrinkwrap":false,"publish_time":1641170361159,"_cnpm_publish_time":1641170361159,"dist-tags":{"latest":"2.6.0","next":"2.0.0-rc.0","nightly":"2.6.1-nightly.2740"}}