{"_id":"@cjser/write-json-file__v6_0_0","name":"@cjser/write-json-file__v6_0_0","dist-tags":{"latest":"6.0.0-cjser.2"},"versions":{"6.0.0-cjser.2":{"name":"@cjser/write-json-file__v6_0_0","version":"6.0.0-cjser.2","description":"Stringify and write JSON to a file atomically","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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":{"write-file-atomic":"^5.0.1","@cjser/detect-indent":"7.0.2-cjser.2","@cjser/is-plain-obj":"4.1.0-cjser.2","@cjser/sort-keys__v5_1_0":"5.1.0-cjser.2"},"devDependencies":{"ava":"^6.1.3","tempy":"^2.0.0","tsd":"^0.31.1","xo":"^0.59.2"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"6.0.0","cjserVersion":2,"original":{"name":"write-json-file","version":"6.0.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/write-json-file","dependencies":{"detect-indent":"^7.0.1","is-plain-obj":"^4.1.0","sort-keys":"^5.0.0","write-file-atomic":"^5.0.1"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/write-json-file__v6_0_0@6.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-DjkfZI0okj8KFyi9Yau68eMospFDx0oUr/qUuCqEldJ6J6dZYRyJKEkWi2Bt7o5FuzrnI9VlbJBb2w7b407BRg==","shasum":"9a764e9bad4459087867d3d29bc1dda1e342ba54","tarball":"https://registry.npmjs.org/@cjser/write-json-file__v6_0_0/-/write-json-file__v6_0_0-6.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":13104,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTDOScr1IPUkbEz2+pJNWV6PeVg9VJZ9lot2LVoCt23wIgWvjkGJBgJrjiHSuiwpggd6avjHJcdy07xZifazu6P64="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/write-json-file__v6_0_0_6.0.0-cjser.2_1778160636877_0.9961312286404531"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:30:36.740Z","6.0.0-cjser.2":"2026-05-07T13:30:37.055Z","modified":"2026-05-07T13:30:37.302Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Stringify and write JSON to a file atomically","keywords":["write","json","stringify","file","fs","graceful","stable","sort","newline","indent","atomic","atomically"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/write-json-file\n","readmeFilename":"readme.md","_rev":"1-0151b53abaeb63b89fffa569d3bb721b"}