New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@xriss/djon

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@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
Source
npmnpm
Version
1.251031.1
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 31 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts