{"name":"confbox","version":"0.2.2","keywords":["yaml","toml","jsonc","json5","unjs","config","ini"],"license":"MIT","_id":"confbox@0.2.2","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/unjs/confbox#readme","bugs":{"url":"https://github.com/unjs/confbox/issues"},"dist":{"shasum":"8652f53961c74d9e081784beed78555974a9c110","tarball":"http://registry-npm.ywwl.com/confbox/download/confbox-0.2.2.tgz","fileCount":18,"integrity":"sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==","signatures":[{"sig":"MEQCIDI++W/6SrKoKc/nLJDuBXP+HiQRVulSN91RXMD6RyVIAiBhp05zVUg/6CSn7Xe9JVKeNJstSVWqCsRRLrL7dMSsyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":134791,"size":39652,"noattachment":false,"key":"/confbox/-/confbox-0.2.2.tgz"},"type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./ini":{"types":"./dist/ini.d.mts","default":"./dist/ini.mjs"},"./toml":{"types":"./dist/toml.d.mts","default":"./dist/toml.mjs"},"./yaml":{"types":"./dist/yaml.d.mts","default":"./dist/yaml.mjs"},"./json5":{"types":"./dist/json5.d.mts","default":"./dist/json5.mjs"},"./jsonc":{"types":"./dist/jsonc.d.mts","default":"./dist/jsonc.mjs"}},"gitHead":"726824f9d3206386e26ae41504afa36eef1d32e3","scripts":{"dev":"vitest dev --coverage","lint":"eslint && prettier -c src test","test":"pnpm lint && pnpm test:types && vitest run --coverage","bench":"pnpm build && node test/bench.mjs","build":"unbuild","prepack":"pnpm build","release":"pnpm test && changelogen --release && npm publish && git push --follow-tags","lint:fix":"eslint --fix && prettier -c src test -w","test:types":"tsc --noEmit --skipLibCheck"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/unjs/confbox.git","type":"git"},"_npmVersion":"10.9.2","description":"Compact YAML, TOML, JSONC, JSON5 and INI parser and serializer","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.7.1","devDependencies":{"ini":"^5.0.0","jiti":"^2.4.2","toml":"^3.0.0","yaml":"^2.7.1","json5":"^2.2.3","automd":"^0.4.0","eslint":"^9.23.0","mitata":"^1.0.34","vitest":"^3.1.1","js-toml":"^1.0.1","js-yaml":"^4.1.0","unbuild":"^3.5.0","prettier":"^3.5.3","smol-toml":"^1.3.1","@types/ini":"^4.1.1","typescript":"^5.8.2","@types/node":"^22.14.0","changelogen":"^0.6.1","jsonc-parser":"^3.3.1","detect-indent":"^7.0.1","@types/js-yaml":"^4.0.9","eslint-config-unjs":"^0.4.2","@vitest/coverage-v8":"^3.1.1"},"_npmOperationalInternal":{"tmp":"tmp/confbox_0.2.2_1743682234650_0.0638099796977174","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":1743682234882,"_cnpm_publish_time":1743682234882,"dist-tags":{"latest":"0.3.2"}}