{"name":"write-json-file","version":"6.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":">=18"},"scripts":{"test":"xo && ava && 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":"^5.0.0","write-file-atomic":"^5.0.1"},"devDependencies":{"ava":"^6.1.3","tempy":"^2.0.0","tsd":"^0.31.1","xo":"^0.59.2"},"_id":"write-json-file@6.0.0","gitHead":"301b0780592893953a6b6566e3ec92bca342def1","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/write-json-file/issues"},"homepage":"https://github.com/sindresorhus/write-json-file#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-MNHcU3f9WxnNyR6MxsYSj64Jz0+dwIpisWKWq9gqLj/GwmA9INg3BZ3vt70/HB3GEwrnDQWr4RPrywnhNzmUFA==","shasum":"52f5d8178c5beb543ed14a2a24195b696b27e7cb","tarball":"http://registry-npm.ywwl.com/write-json-file/download/write-json-file-6.0.0.tgz","fileCount":5,"unpackedSize":7410,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDBEQ5i96NYQAV0dI/wR/gvDZDt8UVcjtRVRWWDRZaRfAiEAlq8WlM7EAxYJBBUPjBg3MZ6Av6QF+cemfBivXpWgIUc="}],"size":2904,"noattachment":false,"key":"/write-json-file/-/write-json-file-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-json-file_6.0.0_1721993135781_0.11900128404336607"},"_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":1721993135937,"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_cnpm_publish_time":1721993135937,"dist-tags":{"latest":"7.0.0"}}