{"name":"write-json-file","version":"7.0.0","description":"Stringify and write JSON to a file atomically","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-json-file.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && node test.js && tsd"},"keywords":["write","json","stringify","file","fs","graceful","stable","sort","newline","indent","atomic","atomically"],"dependencies":{"detect-indent":"^7.0.1","is-plain-obj":"^4.1.0","sort-keys":"^6.0.0","write-file-atomic":"^6.0.0"},"devDependencies":{"tsd":"^0.33.0","xo":"^1.2.2"},"_id":"write-json-file@7.0.0","gitHead":"0df5573675c87b98e83540e88e84090c322d09f3","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/write-json-file/issues"},"homepage":"https://github.com/sindresorhus/write-json-file#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-rj8As6LkachKauGxvZkFzCEd6hIRTi9FKtCNKOa4SaH5vPOiACbGcmPUEJXgkhTHwzNsYmcSbD3C9a6whBfyOg==","shasum":"c05e06eda43715c99008f22f8c4b6d18bda948ef","tarball":"http://registry-npm.ywwl.com/write-json-file/download/write-json-file-7.0.0.tgz","fileCount":5,"unpackedSize":7378,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHS/f2BxdXo9eu5mt2wpUnlzxvNcFmNfRLBPPJK3bFHwAiEAnsA+1hfAW94df/zXw4ehSp2/ycEfWzn5m93FW9FkfPg="}],"size":2886,"noattachment":false,"key":"/write-json-file/-/write-json-file-7.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/write-json-file_7.0.0_1757889470097_0.5849780299859981"},"_hasShrinkwrap":false,"readme":"# write-json-file\n\n> Stringify and write JSON to a file [atomically](https://github.com/npm/write-file-atomic)\n\nCreates directories for you as needed.\n\n## Install\n\n```sh\nnpm install write-json-file\n```\n\n## Usage\n\n```js\nimport {writeJsonFile} from 'write-json-file';\n\nawait writeJsonFile('foo.json', {foo: true});\n```\n\n## API\n\n### writeJsonFile(filePath, data, options?)\n\nReturns a `Promise`.\n\n### writeJsonFileSync(filePath, data, options?)\n\n#### options\n\nType: `object`\n\n##### indent\n\nType: `string | number | undefined`\\\nDefault: `'\\t'`\n\nIndentation as a string or number of spaces.\n\nPass in `undefined` for no formatting.\n\nIf you set both this and `detectIndent`, this value will be used when the indentation cannot be detected.\n\n##### detectIndent\n\nType: `boolean`\\\nDefault: `false`\n\nDetect indentation automatically if the file exists.\n\n##### sortKeys\n\nType: `boolean | Function`\\\nDefault: `false`\n\nSort the keys recursively.\n\nOptionally pass in a [`compare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function.\n\n##### replacer\n\nType: `Function`\n\nPassed into [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter).\n\n##### mode\n\nType: `number`\\\nDefault: `0o666`\n\nThe [mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file.\n\n## Related\n\n- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file\n- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed\n","publish_time":1757889470260,"_cnpm_publish_time":1757889470260,"dist-tags":{"latest":"7.0.0"}}