Skip to contentpackage
confbox
v0.3.2Compact YAML, TOML, JSONC, JSON5 and INI parser and serializer
node any0 depsesmtypesopen source
- license
- MIT
- deps
- 0
- unpacked
- 129.8 kB
- files
- 28
- node
- any
$npm install confbox@0.3.2 README
GitHub-flavored package documentation.
downloads
Across all versions, last 30 days.
109,611,867weekly+2.5%
408,362,164 in 30 days
Oct 16 → Nov 14hover or arrows
compatibility
Runtime metadata.
keywords
Tagged topics.
configinijson5jsonctomlunjsyaml
versions
Latest published Oct 29, 2026
maintainers
Registry package owners.
install size
Estimated unpacked size across 1 packages.
129.8 kB
Includes dependencies.
contents
- Usage
- parseINI(text, options?)
- parseJSON(text, options?)
- parseJSON5(text, options?)
- parseJSONC(text, options?)
- parseTOML(text)
- parseYAML(text, options?)
- stringifyINI(value, options?)
- stringifyJSON(value, options?)
- stringifyJSON5(value, options?)
- stringifyJSONC(value, options?)
- stringifyTOML(value)
- stringifyYAML(value, options?)
- Contribution
- License
✨ Zero dependency and tree-shakable
✨ Types exported out of the box
✨ Preserves code style (indentation and whitespace)
[!TIP]
Use unjs/c12 for a full featured configuration loader!
Usage
# ✨ Auto-detect
npx nypm install confbox
# npm
npm install confbox
# yarn
yarn add confbox
# pnpm
pnpm add confbox
# bun
bun install confbox
# deno
deno install npm:confbox
import {
parseJSON5,
stringifyJSON5,
parseJSONC,
stringifyJSONC,
parseYAML,
stringifyYAML,
parseJSON,
stringifyJSON,
parseTOML,
stringifyTOML,
parseINI,
stringifyINI,
} from "confbox";
import {
parseJSON5,
stringifyJSON5,
parseJSONC,
stringifyJSONC,
parseYAML,
stringifyYAML,
parseJSON,
stringifyJSON,
parseTOML,
stringifyTOML,
parseINI,
stringifyINI,
} from "https://esm.sh/confbox";
parseINI(text, options?)
Converts an INI string into an object.
Note: Style and indentation are not preserved currently.
parseJSON(text, options?)
Converts a JSON string into an object.
Indentation status is auto-detected and preserved when stringifying back using stringifyJSON
parseJSON5(text, options?)
Converts a JSON5 string into an object.
parseJSONC(text, options?)
Converts a JSONC string into an object.
parseTOML(text)
Converts a TOML string into an object.
parseYAML(text, options?)
Converts a YAML string into an object.
stringifyINI(value, options?)
Converts a JavaScript value to an INI string.
Note: Style and indentation are not preserved currently.
stringifyJSON(value, options?)
Converts a JavaScript value to a JSON string.
Indentation status is auto detected and preserved when using value from parseJSON.
stringifyJSON5(value, options?)
Converts a JavaScript value to a JSON5 string.
stringifyJSONC(value, options?)
Converts a JavaScript value to a JSONC string.
stringifyTOML(value)
Converts a JavaScript value to a TOML string.
stringifyYAML(value, options?)
Converts a JavaScript value to a YAML string.
Contribution
Local development
- Clone this repository
- Install the latest LTS version of Node.js
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
- Run tests using
pnpm dev or pnpm test
License