{"_id":"write-pkg","_rev":"3959833","name":"write-pkg","description":"Write a package.json file","dist-tags":{"latest":"7.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-09-01T01:44:41.000Z","created":"2015-09-02T08:59:08.960Z","7.0.0":"2023-11-04T10:19:39.687Z","6.0.1":"2023-11-04T10:10:47.725Z","6.0.0":"2023-07-14T23:42:39.578Z","5.1.0":"2022-03-20T17:53:05.869Z","5.0.0":"2021-08-14T23:57:05.385Z","4.0.0":"2019-04-29T10:37:09.855Z","3.2.0":"2018-06-07T05:44:16.456Z","3.1.0":"2017-06-27T11:49:32.403Z","3.0.1":"2017-04-17T08:12:17.403Z","3.0.0":"2017-04-17T06:25:11.376Z","2.1.0":"2017-03-04T10:29:37.700Z","2.0.0":"2016-10-11T08:26:36.061Z","1.0.0":"2015-09-02T08:59:08.960Z"},"users":{"kiinlam":true,"aidenzou":true,"zalithka":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"versions":{"7.0.0":{"name":"write-pkg","version":"7.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"deepmerge-ts":"^5.1.0","read-pkg":"^8.1.0","sort-keys":"^5.0.0","type-fest":"^4.6.0","write-json-file":"^5.0.0"},"devDependencies":{"ava":"^5.3.1","esmock":"^2.5.8","filter-anything":"^3.0.7","tempy":"^3.1.0","tsd":"^0.29.0","xo":"^0.56.0"},"ava":{"nodeArguments":["--loader=esmock","--no-warnings=ExperimentalWarning"]},"types":"./index.d.ts","gitHead":"9ce4db0ef78442d3a64d008996de2072a65ace2b","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@7.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"9009082bf3c3a39e3026bc7f400f77278641c5f6","size":4272,"noattachment":false,"key":"/write-pkg/-/write-pkg-7.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-7.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_7.0.0_1699093179480_0.6954829626420276"},"_hasShrinkwrap":false,"deprecated":"Renamed to write-package","_cnpmcore_publish_time":"2023-11-04T10:19:39.687Z","publish_time":1699093179687,"_source_registry_name":"default","_cnpm_publish_time":1699093179687},"6.0.1":{"name":"write-pkg","version":"6.0.1","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"deepmerge-ts":"^5.1.0","read-pkg":"^8.1.0","sort-keys":"^5.0.0","type-fest":"^4.6.0","write-json-file":"^5.0.0"},"devDependencies":{"ava":"^5.3.1","esmock":"^2.5.8","filter-anything":"^3.0.7","tempy":"^3.1.0","tsd":"^0.29.0","xo":"^0.56.0"},"ava":{"nodeArguments":["--loader=esmock","--no-warnings=ExperimentalWarning"]},"types":"./index.d.ts","gitHead":"9ce4db0ef78442d3a64d008996de2072a65ace2b","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@6.0.1","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"5b5ec22edf199f372b68c54d3f80b112c8463a6e","size":4272,"noattachment":false,"key":"/write-pkg/-/write-pkg-6.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-6.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_6.0.1_1699092647458_0.5704901286173374"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T10:10:47.725Z","publish_time":1699092647725,"_source_registry_name":"default","_cnpm_publish_time":1699092647725},"6.0.0":{"name":"write-pkg","version":"6.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"deepmerge-ts":"^5.1.0","read-pkg":"^8.0.0","sort-keys":"^5.0.0","type-fest":"^3.13.0","write-json-file":"^5.0.0"},"devDependencies":{"ava":"^5.3.1","filter-anything":"^3.0.7","tempy":"^3.1.0","tsd":"^0.28.1","xo":"^0.54.2"},"types":"./index.d.ts","gitHead":"174252d7df4dc473bbc1755ce84d69c1545c659c","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@6.0.0","_nodeVersion":"16.20.0","_npmVersion":"9.2.0","dist":{"shasum":"2a3f89b8c5f8ad2bb1987aafef4d4354d39b0a40","size":4236,"noattachment":false,"key":"/write-pkg/-/write-pkg-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_6.0.0_1689378159405_0.2891605372641679"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-14T23:42:39.578Z","publish_time":1689378159578,"_source_registry_name":"default","_cnpm_publish_time":1689378159578},"5.1.0":{"name":"write-pkg","version":"5.1.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"sort-keys":"^5.0.0","type-fest":"^2.12.1","write-json-file":"^5.0.0"},"devDependencies":{"ava":"^4.1.0","read-pkg":"^7.1.0","tempfile":"^4.0.0","tsd":"^0.19.1","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"c17591ec40f08f7e0e3ff1691a05c8ebda8e23f9","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@5.1.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.2","dist":{"shasum":"421fca18c1b365aa4de7dac29e17539a7c53e06a","size":2668,"noattachment":false,"key":"/write-pkg/-/write-pkg-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_5.1.0_1647798785695_0.3793302058732606"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-20T17:53:11.668Z","publish_time":1647798785869,"_cnpm_publish_time":1647798785869},"5.0.0":{"name":"write-pkg","version":"5.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"sort-keys":"^5.0.0","type-fest":"^2.0.0","write-json-file":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","read-pkg":"^7.0.0","tempfile":"^4.0.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"cbef61b69df4b445759d5a153840cb81ce94745c","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@5.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"b9fab4e78ee0e71b980867f2baff8b8564a77d26","size":2551,"noattachment":false,"key":"/write-pkg/-/write-pkg-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_5.0.0_1628985425238_0.5781509486605558"},"_hasShrinkwrap":false,"publish_time":1628985425385,"_cnpm_publish_time":1628985425385},"4.0.0":{"name":"write-pkg","version":"4.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","write","stringify","file","fs","graceful","package"],"dependencies":{"sort-keys":"^2.0.0","type-fest":"^0.4.1","write-json-file":"^3.2.0"},"devDependencies":{"ava":"^1.4.1","read-pkg":"^5.1.1","tempfile":"^3.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"088d9af22ed2ac3562194aac22a609318a83dc4a","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@4.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"675cc04ef6c11faacbbc7771b24c0abbf2a20039","size":2438,"noattachment":false,"key":"/write-pkg/-/write-pkg-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_4.0.0_1556534229756_0.971808952976889"},"_hasShrinkwrap":false,"publish_time":1556534229855,"_cnpm_publish_time":1556534229855},"3.2.0":{"name":"write-pkg","version":"3.2.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"sort-keys":"^2.0.0","write-json-file":"^2.2.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^2.0.0","xo":"*"},"gitHead":"e379f4c8e90fafc7cf42f29b031095484fd00c2d","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@3.2.0","_npmVersion":"6.1.0","_nodeVersion":"8.11.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0e178fe97820d389a8928bc79535dbe68c2cff21","size":2065,"noattachment":false,"key":"/write-pkg/-/write-pkg-3.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-3.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg_3.2.0_1528350256397_0.04229308865990489"},"_hasShrinkwrap":false,"publish_time":1528350256456,"_cnpm_publish_time":1528350256456},"3.1.0":{"name":"write-pkg","version":"3.1.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"sort-keys":"^2.0.0","write-json-file":"^2.2.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^2.0.0","xo":"*"},"gitHead":"d52facbea93e7154adb1aef7d3fa0c9de7971bb2","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@3.1.0","_shasum":"030a9994cc9993d25b4e75a9f1a1923607291ce9","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"030a9994cc9993d25b4e75a9f1a1923607291ce9","size":1992,"noattachment":false,"key":"/write-pkg/-/write-pkg-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write-pkg-3.1.0.tgz_1498564171284_0.9126556434202939"},"directories":{},"publish_time":1498564172403,"_hasShrinkwrap":false,"_cnpm_publish_time":1498564172403},"3.0.1":{"name":"write-pkg","version":"3.0.1","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"sort-keys":"^1.1.2","write-json-file":"^2.0.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^2.0.0","xo":"*"},"gitHead":"76fc2da5f3313a469a216b442b09725151dd6851","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@3.0.1","_shasum":"f95245805be6f6a4eb1d6c31c43b57226815e6e3","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f95245805be6f6a4eb1d6c31c43b57226815e6e3","size":1976,"noattachment":false,"key":"/write-pkg/-/write-pkg-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-3.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/write-pkg-3.0.1.tgz_1492416735543_0.7104205472860485"},"directories":{},"publish_time":1492416737403,"_cnpm_publish_time":1492416737403,"_hasShrinkwrap":false},"3.0.0":{"name":"write-pkg","version":"3.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"sort-keys":"^1.1.2","write-json-file":"^2.0.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^2.0.0","xo":"*"},"gitHead":"3b10e98079ba54dd6856e426ab689d93d3543655","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@3.0.0","_shasum":"58b9ce0d00f3e6f5d77204419b574b9ffb65f074","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"58b9ce0d00f3e6f5d77204419b574b9ffb65f074","size":1971,"noattachment":false,"key":"/write-pkg/-/write-pkg-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/write-pkg-3.0.0.tgz_1492410311067_0.6549546655733138"},"directories":{},"publish_time":1492410311376,"_hasShrinkwrap":false,"_cnpm_publish_time":1492410311376},"2.1.0":{"name":"write-pkg","version":"2.1.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"sort-keys":"^1.1.2","write-json-file":"^2.0.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^1.1.1","xo":"*"},"gitHead":"d1709c25dbd97ca1899c09e20bc10060f162ea63","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@2.1.0","_shasum":"353aa44c39c48c21440f5c08ce6abd46141c9c08","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"353aa44c39c48c21440f5c08ce6abd46141c9c08","size":1954,"noattachment":false,"key":"/write-pkg/-/write-pkg-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/write-pkg-2.1.0.tgz_1488623375785_0.45609515625983477"},"directories":{},"publish_time":1488623377700,"_cnpm_publish_time":1488623377700,"_hasShrinkwrap":false},"2.0.0":{"name":"write-pkg","version":"2.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"write-json-file":"^2.0.0"},"devDependencies":{"ava":"*","read-pkg":"^2.0.0","tempfile":"^1.1.1","xo":"*"},"xo":{"esnext":true},"gitHead":"c794db0b89e13ea5517e8680cfdb63285563b864","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@2.0.0","_shasum":"93b922ee9a429f9bd74cdc69e549733c9e468156","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"93b922ee9a429f9bd74cdc69e549733c9e468156","size":1803,"noattachment":false,"key":"/write-pkg/-/write-pkg-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/write-pkg-2.0.0.tgz_1476174395847_0.6209705518558621"},"directories":{},"publish_time":1476174396061,"_cnpm_publish_time":1476174396061,"_hasShrinkwrap":false},"1.0.0":{"name":"write-pkg","version":"1.0.0","description":"Write a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/write-pkg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["json","write","stringify","file","fs","graceful","pkg","package"],"dependencies":{"write-json-file":"^1.1.0"},"devDependencies":{"ava":"*","read-pkg":"^1.0.0","tempfile":"^1.1.1","xo":"*"},"gitHead":"ded494832a13795141d3fcc2965c4d05346a96f9","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"homepage":"https://github.com/sindresorhus/write-pkg#readme","_id":"write-pkg@1.0.0","_shasum":"aeb8aa9d4d788e1d893dfb0854968b543a919f57","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"aeb8aa9d4d788e1d893dfb0854968b543a919f57","size":1792,"noattachment":false,"key":"/write-pkg/-/write-pkg-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-pkg/download/write-pkg-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1441184348960,"_cnpm_publish_time":1441184348960,"_hasShrinkwrap":false}},"readme":"# write-pkg\n\n> Write a `package.json` file\n\nWrites atomically and creates directories for you as needed. Sorts dependencies when writing. Preserves the indentation if the file already exists.\n\n## Install\n\n```sh\nnpm install write-pkg\n```\n\n## Usage\n\n```js\nimport path from 'node:path';\nimport {writePackage} from 'write-pkg';\n\nawait writePackage({foo: true});\nconsole.log('done');\n\nawait writePackage(path.join('unicorn', 'package.json'), {foo: true});\nconsole.log('done');\n```\n\n## API\n\n### writePackage(path?, data, options?)\n\nReturns a `Promise` that resolves when the `package.json` file has been written.\n\n### writePackageSync(path?, data, options?)\n\n#### path\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe path to where the `package.json` file should be written or its directory.\n\n#### data\n\nType `object`\n\nJSON data to write to the `package.json` file.\n\n#### options\n\nType: `object`\n\nSee [Options](#options-4).\n\n### updatePackage(path?, data, options?)\n\nReturns a `Promise` that resolves when the `package.json` file has been updated.\n\n### updatePackageSync(path?, data, options?)\n\n```js\nimport {updatePackage} from 'write-pkg';\n\nawait updatePackage({foo: true});\n//=> { \"foo\": true }\n\nawait updatePackage({foo: false, bar: true});\n//=> { \"foo\": false, \"bar\": true }\n```\n\n#### path\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe path to where the `package.json` file should be written or its directory.\n\n#### data\n\nType `object`\n\nJSON data to write to the `package.json` file. If the file already exists, existing fields will be merged with the values in `data`.\n\n#### options\n\nType: `object`\n\nSee [Options](#options-4).\n\n### addPackageDependencies(path?, dependencies, options?)\n\nReturns a `Promise` that resolves when the `package.json` file has been written.\n\n### addPackageDependenciesSync(path?, dependencies, options?)\n\n```js\nimport {writePackage, addPackageDependencies} from 'write-pkg';\n\nawait writePackage({foo: true});\n//=> { \"foo\": true }\n\nawait addPackageDependencies({foo: '1.0.0'});\n//=> { \"foo\": true, \"dependencies\": { \"foo\": \"1.0.0\" } }\n\nawait addPackageDependencies({dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}});\n//=> { \"foo\": true, \"dependencies\": { \"foo\": \"1.0.0\" }, \"devDependencies\": { \"bar\": \"1.0.0\" } }\n```\n\n#### path\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe path to where the `package.json` file should be written or its directory.\n\n#### dependencies\n\nType: `Record<string, string> | Partial<Record<'dependencies' | 'devDependencies' | 'optionalDependencies' | 'peerDependencies', Record<string, string>>>`\n\nDependencies to add to the `package.json` file.\n\n#### options\n\nType: `object`\n\nSee [Options](#options-4).\n\n### removePackageDependencies(path?, dependencies, options?)\n\nReturns a `Promise` that resolves when the `package.json` file has been written. Does not throw if the file does not exist.\n\n### removePackageDependenciesSync(path?, dependencies, options?)\n\n```js\nimport {writePackage, removePackageDependencies} from 'write-pkg';\n\nawait writePackage({foo: true, dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}});\n//=> { \"foo\": true, \"dependencies\": { \"foo\": \"1.0.0\" }, \"devDependencies\": { \"bar\": \"1.0.0\" } }\n\nawait removePackageDependencies(['foo']);\n//=> { \"foo\": true, \"devDependencies\": { \"bar\": \"1.0.0\" } }\n\nawait removePackageDependencies({devDependencies: ['bar']});\n//=> { \"foo\": true }\n```\n\n#### path\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe path to where the `package.json` file should be written or its directory.\n\n#### dependencies\n\nType `string[] | Partial<Record<'dependencies' | 'devDependencies' | 'optionalDependencies' | 'peerDependencies', string[]>>`\n\nDependencies to remove from the `package.json` file.\n\n#### options\n\nType: `object`\n\nSee [Options](#options-4).\n\n### Options\n\n##### indent\n\nType: `string | number`\\\nDefault: Auto-detected or `'\\t'`\n\nThe indentation to use for new files.\n\nAccepts `'\\t'` for tab indentation or a number of spaces.\n\nIf the file already exists, the existing indentation will be used.\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\nRemove empty `dependencies`, `devDependencies`, `optionalDependencies` and `peerDependencies` objects.\n\n## write-pkg for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of write-pkg and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-write-pkg?utm_source=npm-write-pkg&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## Related\n\n- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a `package.json` file\n- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically\n\n","_attachments":{},"homepage":"https://github.com/sindresorhus/write-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/write-pkg/issues"},"license":"MIT"}