gon-freecss
v1.0.0
Published
Parse Glaiel's Object Notation (GON) files
Readme
Gon Freecss
A zero-dependency GON parser for JavaScript.
Description
This library allows you to parse GON (Glaiel Object Notation) structures into JSON.
Features
- Parses all constructs: literals, arrays and objects.
- Supports merging and combining syntax.
- Zero dependencies.
Installation
npm install gon-freecss
yarn add gon-freecssUsage
import parse from 'gon-freecss';
function main() {
const source = `big_factory {
name Acme
size large
products Corks
products "Fly Paper"
products Anvil
}`;
const gon = parse(source);
console.log(gon);
}It will produce the following JSON:
{
"big_factory": {
"name": "Acme",
"size": "large",
"products": [
"Corks",
"Fly Paper",
"Anvil"
]
}
}