Skip to contentpackage
confbox
v0.2.2Compact YAML, TOML, JSONC, JSON5 and INI parser and serializer
node any0 depsesmtypesopen source
- license
- MIT
- deps
- 0
- unpacked
- 131.6 kB
- files
- 18
- node
- any
$npm install confbox@0.2.2 README
GitHub-flavored package documentation.
downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
keywords
Tagged topics.
yamltomljsoncjson5unjsconfigini
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