# @xriss/djon

> DJON is a UTF8 only relaxed superset of JSON. DJON supports round trip comments, numbers are explicitly 64bit floats and strings can contain raw binary data.

Latest version **1.261119.1** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xriss/djon
pnpm add @xriss/djon
yarn add @xriss/djon
bun add @xriss/djon
```

Provides the command `djon`.

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.261119.1 |
| Published | 2026-11-19 |
| First published | 2023-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=23.0.0 |
| Dependencies | 1 |
| Unpacked size | 169.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | xriss |

## Links

- npm: https://www.npmjs.com/package/@xriss/djon
- Repository: https://github.com/xriss/djon
- Homepage: https://github.com/xriss/djon#readme
- Issues: https://github.com/xriss/djon/issues
- npm.io page: https://npm.io/package/@xriss/djon

## Dependencies (1)

- [napi-wasm](https://npm.io/package/napi-wasm.md) ^1.1.0

## Recent versions

- 1.261119.1 (latest) — 2026-11-19
- 1.260512.1 — 2026-05-12
- 1.251031.1 — 2025-10-31
- 1.241016.23 — 2025-08-01
- 1.241016.22 — 2025-08-01
- 1.241016.21 — 2025-08-01
- 1.241016.20 — 2025-08-01
- 1.241016.19 — 2025-08-01
- 1.241016.4 — 2024-10-16
- 1.241016.3 — 2024-10-16
- 1.241016.1 — 2024-10-16
- 1.241016.0 — 2024-10-15
- 0.0.18 — 2024-10-04
- 0.0.17 — 2024-10-04
- 0.0.16 — 2024-09-23
- … 15 more at https://npm.io/package/@xriss/djon/versions

## README

DJON is a UTF8 only relaxed superset of JSON. DJON supports round trip 
comments, numbers are explicitly 64bit floats and strings can contain 
raw binary data.

This is implimented as a c module using wasm so must be imported rather 
than required as it needs async to load the wasm.

A valid utf8 json file is always a valid djon file.

Djon is half man half machine:

Pretty djon makes for more human readable and editable json style 
configuration files and compact djon is a machine readable format that 
can store binary data.

	import djon from "@xriss/djon"

	let data = djon.load_file("filename.json") // load in djon/json format
	
	djon.save_file("filename.json",data) // pretty json
	djon.save_file("filename.compact.json",data,"compact") // compact json
	djon.save_file("filename.djon",data,"djon") // pretty djon
	djon.save_file("filename.compact.djon",data,"djon","compact") // compact djon

	let text = djon.save(data,"djon") // save to string

	let datb = djon.load(text) // load from string

	// resave a djon file, pre-existing comments will be preserved
	// can be used to round trip comments in config files
	djon.save_comments("filename.djon",data)


if you are stuck in cjs then you may also use the nodejs import 

	let djon=(await import("@xriss/djon")).default

---
_Source: https://npm.io/package/@xriss/djon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
