{"name":"confbox","version":"0.1.2","description":"Compact and high quality YAML, TOML, JSONC and JSON5 parsers","keywords":["yaml","toml","jsonc","json5","unjs","config"],"repository":{"type":"git","url":"git+https://github.com/unjs/confbox.git"},"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./json5":{"types":"./dist/json5.d.ts","import":"./dist/json5.mjs","require":"./dist/json5.cjs"},"./jsonc":{"types":"./dist/jsonc.d.ts","import":"./dist/jsonc.mjs","require":"./dist/jsonc.cjs"},"./toml":{"types":"./dist/toml.d.ts","import":"./dist/toml.mjs","require":"./dist/toml.cjs"},"./yaml":{"types":"./dist/yaml.d.ts","import":"./dist/yaml.mjs","require":"./dist/yaml.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"unbuild","dev":"vitest dev --coverage","bench":"pnpm build && node test/bench.mjs","lint":"eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test","lint:fix":"eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w","prepack":"pnpm build","release":"pnpm test && changelogen --release && npm publish && git push --follow-tags","test":"pnpm lint && pnpm test:types && vitest run --coverage","test:types":"tsc --noEmit --skipLibCheck"},"devDependencies":{"@types/js-yaml":"^4.0.9","@types/node":"^20.11.19","@vitest/coverage-v8":"^1.3.0","automd":"^0.3.2","changelogen":"^0.5.5","eslint":"^8.56.0","eslint-config-unjs":"^0.2.1","jiti":"^1.21.0","js-toml":"^1.0.0","js-yaml":"^4.1.0","json5":"^2.2.3","jsonc-parser":"^3.2.1","mitata":"^0.1.11","prettier":"^3.2.5","smol-toml":"^1.1.4","toml":"^3.0.0","typescript":"^5.3.3","unbuild":"^2.0.0","vitest":"^1.3.0","yaml":"^2.3.4"},"packageManager":"pnpm@8.12.1","_id":"confbox@0.1.2","gitHead":"eec9adc6233c01e875cef6d353200970e24047b0","bugs":{"url":"https://github.com/unjs/confbox/issues"},"homepage":"https://github.com/unjs/confbox#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-+8wbe/gFvXyJzqaRiomHXT3Jk0CkOkHesL65DjR5D98xU4Sq4Pvw2BwihLS30L6ZXWm1Cle7NLOFV3z7bCnzHA==","shasum":"e42fc7bb316d6f38b27380ce86c1a64c61cc0804","tarball":"http://registry-npm.ywwl.com/confbox/download/confbox-0.1.2.tgz","fileCount":32,"unpackedSize":237664,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9m2bOOPAMx/8KiAKTOi/1oVu+ZmzP7vrd5nF4FjM8iwIhAMT3JdrNWvmcGne4Z19FYIxbbaEaw2ndHdkyIUOc55wb"}],"size":66721,"noattachment":false,"key":"/confbox/-/confbox-0.1.2.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.1.2_1708456331900_0.6814377839959183"},"_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":1708456332083,"_cnpm_publish_time":1708456332083,"dist-tags":{"latest":"0.3.2"}}