{"name":"confbox","version":"0.0.0","_id":"confbox@0.0.0","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-tTKjM1UdD5EZECnjT9OpAw/fqwfYpbsivf3DyC9XCRWbLKLnIvy1ArVf8N1utqOGyNeCdbOnrvvCNDqQuZc2OQ==","shasum":"db1c67b112d4a53a5c73513615cda9dae6dfd491","tarball":"http://registry-npm.ywwl.com/confbox/download/confbox-0.0.0.tgz","fileCount":1,"unpackedSize":36,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcaOvZujAjIJKWocwu+hD2cj5tteQFWt5EVKlt57cTtgIhALpaQjsQiSUBgyxMECvbjlFkplQSaz6AZH4jkks54sb7"}],"size":135,"noattachment":false,"key":"/confbox/-/confbox-0.0.0.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/confbox_0.0.0_1708426290124_0.8951118239791283"},"_hasShrinkwrap":false,"readme":"# confbox\n\n<!-- automd:badges color=yellow no-npmDownloads bundlephobia packagephobia -->\n\n[![npm version](https://img.shields.io/npm/v/confbox?color=yellow)](https://npmjs.com/package/confbox)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/confbox?color=yellow)](https://bundlephobia.com/package/confbox)\n\n<!-- /automd -->\n\nConfig parsers for:\n\n✅ [YAML](https://yaml.org/) (with [`js-yaml`](https://github.com/nodeca/js-yaml))\n\n✅ [TOML](https://toml.io/) (with [`smol-toml`](https://github.com/squirrelchat/smol-toml))\n\n✅ [JSONC](https://github.com/microsoft/node-jsonc-parser) (with [`jsonc-parser`](https://github.com/microsoft/node-jsonc-parser))\n\n✅ [JSON5](https://json5.org/) (with [`json5`](https://github.com/json5/json5))\n\n✅ [JSON](https://www.json.org/json-en.html) \n\nWith perfect bundling:\n\n✨ Types exported out of the box\n\n✨ Zero config and compact redistribution\n\n✨ Dual ESM/CJS build\n\n✨ Consistent and tested API\n\n✨ Handpicked best libraries (bundle+perf)\n\n✨ Auto detects indentation and whitespace when parsing and preservers when serializing \n\n> [!NOTE]\n> Use [unjs/c12](https://github.com/unjs/c12) for a full featured configuration loader!\n\n## Usage\n\nInstall package:\n\n<!-- automd:pm-i no-version -->\n\n```sh\n# ✨ Auto-detect\nnpx nypm install confbox\n\n# npm\nnpm install confbox\n\n# yarn\nyarn add confbox\n\n# pnpm\npnpm install confbox\n\n# bun\nbun install confbox\n```\n\n<!-- /automd -->\n\nImport:\n\n<!-- automd:jsimport cjs cdn src=\"./src/index.ts\" -->\n\n**ESM** (Node.js, Bun)\n\n```js\nimport {\n  parseJSON5,\n  stringifyJSON5,\n  parseJSONC,\n  stringifyJSONC,\n  parseYAML,\n  stringifyYAML,\n  parseJSON,\n  stringifyJSON,\n  parseTOML,\n  stringifyTOML,\n} from \"confbox\";\n```\n\n**CommonJS** (Legacy Node.js)\n\n```js\nconst {\n  parseJSON5,\n  stringifyJSON5,\n  parseJSONC,\n  stringifyJSONC,\n  parseYAML,\n  stringifyYAML,\n  parseJSON,\n  stringifyJSON,\n  parseTOML,\n  stringifyTOML,\n} = require(\"confbox\");\n```\n\n**CDN** (Deno, Bun and Browsers)\n\n```js\nimport {\n  parseJSON5,\n  stringifyJSON5,\n  parseJSONC,\n  stringifyJSONC,\n  parseYAML,\n  stringifyYAML,\n  parseJSON,\n  stringifyJSON,\n  parseTOML,\n  stringifyTOML,\n} from \"https://esm.sh/confbox\";\n```\n\n<!-- /automd -->\n\n<!-- automd:jsdocs src=\"./src/index\" -->\n\n### `parseJSON(text, options?)`\n\nConverts a [JSON](https://www.json.org/json-en.html) string into an object.\n\nIndentation status is auto-detected and preserved when stringifying back using `stringifyJSON`\n\n### `parseJSON5(text, options?)`\n\nConverts a [JSON5](https://json5.org/) string into an object.\n\n### `parseJSONC(text, options?)`\n\nConverts a [JSONC](https://github.com/microsoft/node-jsonc-parser) string into an object.\n\n### `parseTOML(text)`\n\nConverts a [TOML](https://toml.io/) string into an object.\n\n### `parseYAML(text, options?)`\n\nConverts a [YAML](https://yaml.org/) string into an object.\n\n### `stringifyJSON(value, options?)`\n\nConverts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.\n\nIndentation status is auto detected and preserved when using value from parseJSON.\n\n### `stringifyJSON5(value, options?)`\n\nConverts a JavaScript value to a [JSON5](https://json5.org/) string.\n\n### `stringifyJSONC(value, options?)`\n\nConverts a JavaScript value to a [JSONC](https://github.com/microsoft/node-jsonc-parser) string.\n\n### `stringifyTOML(value)`\n\nConverts a JavaScript value to a [TOML](https://toml.io/) string.\n\n### `stringifyYAML(value, options?)`\n\nConverts a JavaScript value to a [YAML](https://yaml.org/) string.\n\n<!-- /automd -->\n\n<!-- automd:fetch url=\"gh:unjs/.github/main/snippets/readme-contrib-node-pnpm.md\" -->\n\n## Contribution\n\n<details>\n  <summary>Local development</summary>\n\n- Clone this repository\n- Install the latest LTS version of [Node.js](https://nodejs.org/en/)\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Run tests using `pnpm dev` or `pnpm test`\n\n</details>\n\n<!-- /automd -->\n\n## License\n\n<!-- automd:contributors license=MIT author=pi0 -->\n\nPublished under the [MIT](https://github.com/unjs/confbox/blob/main/LICENSE) license.\nMade by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/confbox/graphs/contributors) 💛\n<br><br>\n<a href=\"https://github.com/unjs/confbox/graphs/contributors\">\n<img src=\"https://contrib.rocks/image?repo=unjs/confbox\" />\n</a>\n\n<!-- /automd -->\n\n<!-- automd:with-automd -->\n\n---\n\n_🤖 auto updated with [automd](https://automd.unjs.io)_\n\n<!-- /automd -->\n","publish_time":1708426290259,"_cnpm_publish_time":1708426290259,"dist-tags":{"latest":"0.3.2"}}