damon2
v2.1.25
Published
A JSON shorthand
Downloads
190
Readme
DAMON: A Map-Oriented Notation
A JSON-shorthand that:
- Stores insertion order
- Embraces the offside-rule
- Reuses JSON types
Demo
Syntax
Use Cases
- Wiki Data-entry
- Software Design
- Interactive Documents
Installation
Node:
npm install damon2
Building
npm run watch # dev
npm run build # distribuable
Usage
Core methods:
let damon = new DAMON();
let damonString =`
- {}
- key: "value"
`;
console.log(damon.damonToJSON(damonString));
// {
// "key": "value"
// }
console.log(damon.jsonToDAMON(damon.damonToJSON(damonString)));
// - {}
// - key: "value"
console.log(damon.damonToMap(damonString));
// Map(1) {"key" => "value"}
Attributions
Built on:
- JSON-types and JSON.parse()
- json-in-order @sanderevers
- DOMPurify @cure53
Going further
License
Copyright © 2024 Adrian Turcev
Licensed under the MPL-2.0 license