Implementation of FRED (Flexible REpresentation of Data) for JavaScript
To install just run: npm install fred-js
FRED (Flexible REpresentation of Data) is a data-interchange format. It was created with the goal to be easy for humans to read and write but also easy to create parsers.
It has more data types than JSON and some features like support for metadata and tags.
The FRED Spec and Grammar is being developed here FRED Grammar and Specification
fred-js was implemented with chevrotain and follows the FRED Spec. It exposes only a function that receives a FRED Text and returns a JavaScript Object.
const parse = require('fred-js')
fredValue = parse("tag (h1=42) { key : true }")
console.log(fredValue)
/*
Print of the console.log
{
tagName: 'tag',
attrs: [ { h1: 42 } ],
atom: [ { key: true } ]
}
*/