{"name":"confbox","version":"0.3.0","keywords":["config","ini","json5","jsonc","toml","unjs","yaml"],"license":"MIT","_id":"confbox@0.3.0","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/unjs/confbox#readme","bugs":{"url":"https://github.com/unjs/confbox/issues"},"dist":{"shasum":"a1bc1b44a97af1040e9990568055a4b6b258c0dd","tarball":"http://registry-npm.ywwl.com/confbox/download/confbox-0.3.0.tgz","fileCount":28,"integrity":"sha512-kwgXY5w5EWPZLpFhvQBPzkujFZtSgq5PtUCoQwfjqkvu5Qgr0w8ctK5zTHOrGLdxTf/5YJf5D5XBnc2UfTAHVw==","signatures":[{"sig":"MEQCICQMr8xFGqJKqShEjZyOJknyMyZy5R6DDG5gtIFFiyNVAiBjKNpSHpq1apKoFjr1MH+cOE/mm9CfN0+PVnQekvPMzA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIEWME7MY1ib2hHm/5QiepRCIUT7vkPs2SDPhSLBEoIS5AiBo+o26gv+4ZNWolr0kRCAD/5V9hvZOZmarUQehF55Oyg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133037,"size":41216,"noattachment":false,"key":"/confbox/-/confbox-0.3.0.tgz"},"type":"module","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./ini":"./dist/ini.mjs","./json":"./dist/json.mjs","./toml":"./dist/toml.mjs","./yaml":"./dist/yaml.mjs","./json5":"./dist/json5.mjs","./jsonc":"./dist/jsonc.mjs"},"scripts":{"dev":"vitest dev --coverage","lint":"oxlint && oxfmt --check src test","test":"pnpm lint && pnpm test:types && vitest run --coverage","bench":"pnpm build && node test/bench.mjs","build":"obuild","prepack":"pnpm build","release":"pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags","lint:fix":"oxlint --fix && oxfmt src test","test:types":"tsc --noEmit --skipLibCheck"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/unjs/confbox.git","type":"git"},"_npmVersion":"12.0.2","description":"Compact YAML, TOML, JSONC, JSON5 and INI parser and serializer","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"devDependencies":{"ini":"^7.0.0","jiti":"^2.7.0","toml":"^5.0.0","yaml":"^2.9.0","json5":"^2.2.3","oxfmt":">=0.66.0","automd":"^0.4.3","mitata":"^1.0.34","obuild":"^0.4.39","oxlint":"^1.81.0","vitest":"^4.1.11","js-toml":"^2.0.1","js-yaml":"^5.4.1","smol-toml":"^1.8.0","@types/ini":"^4.1.1","typescript":"^7","@types/node":"^26","changelogen":"^0.6.2","jsonc-parser":"^3.3.1","detect-indent":"^7.0.2","@vitest/coverage-v8":"^4.1.11","strip-json-comments":"^5.0.1"},"p22ackageManager":"pnpm@11.22.0","_npmOperationalInternal":{"tmp":"tmp/confbox_0.3.0_1788387908140_0.06872227236960726","host":"s3://npm-registry-packages-npm-production"},"readme":"# confbox\n\n<!-- automd:badges color=yellow bundlephobia packagephobia -->\n\n[![npm version](https://img.shields.io/npm/v/confbox?color=yellow)](https://npmjs.com/package/confbox)\n[![npm downloads](https://img.shields.io/npm/dm/confbox?color=yellow)](https://npm.chart.dev/confbox)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/confbox?color=yellow)](https://bundlephobia.com/package/confbox)\n[![install size](https://badgen.net/packagephobia/install/confbox?color=yellow)](https://packagephobia.com/result?p=confbox)\n\n<!-- /automd -->\n\nParsing and serialization utils for [YAML](https://yaml.org/) ([js-yaml](https://github.com/nodeca/js-yaml)), [TOML](https://toml.io/) ([smol-toml](https://github.com/squirrelchat/smol-toml)), [JSONC](https://github.com/microsoft/node-jsonc-parser) ([jsonc-parser](https://github.com/microsoft/node-jsonc-parser)), [JSON5](https://json5.org/) ([json5](https://github.com/json5/json5)), [INI](https://en.wikipedia.org/wiki/INI_file) ([ini](https://www.npmjs.com/package/ini)) and [JSON](https://www.json.org/json-en.html).\n\n✨ Zero dependency and tree-shakable\n\n✨ Types exported out of the box\n\n✨ Preserves code style (indentation and whitespace)\n\n> [!TIP]\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 add confbox\n\n# bun\nbun install confbox\n\n# deno\ndeno install npm:confbox\n```\n\n<!-- /automd -->\n\nImport:\n\n<!-- automd:jsimport cdn src=\"./src/index.ts\" -->\n\n**ESM** (Node.js, Bun, Deno)\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  parseINI,\n  stringifyINI,\n} from \"confbox\";\n```\n\n**CDN** (Deno 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  parseINI,\n  stringifyINI,\n} from \"https://esm.sh/confbox\";\n```\n\n<!-- /automd -->\n\n<!-- automd:jsdocs src=\"./src/index\" -->\n\n### `parseINI(text, options?)`\n\nConverts an [INI](https://www.ini.org/ini-en.html) string into an object.\n\n**Note:** Style and indentation are not preserved currently.\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### `stringifyINI(value, options?)`\n\nConverts a JavaScript value to an [INI](https://www.ini.org/ini-en.html) string.\n\n**Note:** Style and indentation are not preserved currently.\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":1788387908220,"_cnpm_publish_time":1788387908220,"dist-tags":{"latest":"0.3.2"}}