{"id":14156201,"url":"https://github.com/unjs/confbox","last_synced_at":"2025-06-10T22:41:53.698Z","repository":{"id":223490780,"uuid":"760472695","full_name":"unjs/confbox","owner":"unjs","description":"Compact and high quality YAML, TOML, JSONC and JSON5 parsers","archived":false,"fork":false,"pushed_at":"2024-11-26T06:43:28.000Z","size":348,"stargazers_count":229,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-26T07:29:16.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-20T13:40:57.000Z","updated_at":"2024-11-19T16:16:26.000Z","dependencies_parsed_at":"2024-05-01T03:24:45.958Z","dependency_job_id":"a2ba8b4d-10d7-45f4-bb96-6816abcb0c19","html_url":"https://github.com/unjs/confbox","commit_stats":null,"previous_names":["unjs/confbox"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fconfbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fconfbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fconfbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fconfbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unjs","download_url":"https://codeload.github.com/unjs/confbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228829087,"owners_count":17978149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-17T08:05:17.043Z","updated_at":"2025-06-10T22:41:53.682Z","avatar_url":"https://github.com/unjs.png","language":"TypeScript","readme":"# confbox\n\n\u003c!-- automd:badges color=yellow bundlephobia packagephobia --\u003e\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\u003c!-- /automd --\u003e\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\u003e [!TIP]\n\u003e Use [unjs/c12](https://github.com/unjs/c12) for a full featured configuration loader!\n\n## Usage\n\nInstall package:\n\n\u003c!-- automd:pm-i no-version --\u003e\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# deno\ndeno install confbox\n```\n\n\u003c!-- /automd --\u003e\n\nImport:\n\n\u003c!-- automd:jsimport cdn src=\"./src/index.ts\" --\u003e\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, 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  parseINI,\n  stringifyINI,\n} from \"https://esm.sh/confbox\";\n```\n\n\u003c!-- /automd --\u003e\n\n\u003c!-- automd:jsdocs src=\"./src/index\" --\u003e\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\u003c!-- /automd --\u003e\n\n\u003c!-- automd:fetch url=\"gh:unjs/.github/main/snippets/readme-contrib-node-pnpm.md\" --\u003e\n\n## Contribution\n\n\u003cdetails\u003e\n  \u003csummary\u003eLocal development\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003c!-- /automd --\u003e\n\n## License\n\n\u003c!-- automd:contributors license=MIT author=pi0 --\u003e\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\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/unjs/confbox/graphs/contributors\"\u003e\n\u003cimg src=\"https://contrib.rocks/image?repo=unjs/confbox\" /\u003e\n\u003c/a\u003e\n\n\u003c!-- /automd --\u003e\n\n\u003c!-- automd:with-automd --\u003e\n\n---\n\n_🤖 auto updated with [automd](https://automd.unjs.io)_\n\n\u003c!-- /automd --\u003e\n","funding_links":[],"categories":["TypeScript","others","Utilities"],"sub_categories":["Configuration"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fconfbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funjs%2Fconfbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fconfbox/lists"}