A simple markup language designed for non-developers to easily create and update config files.
This module parses Huml into a JSON object.
Based on a natural list writing syntax, subtle differentiation generates Arrays and Objects, something which non-developers should not be expected to know.
Every value in Huml is defined with a starting -
to denote a list item.
Defined by starting -
character and must contain a :
to associate a value.
Strings can be passed without inverted comma definitions, e.g, this is a string
not 'this is a string'
Defined by a Key Value, follow by a list of keys only, starting with -
and no :
to associate values.
Defined by a Key Value, follow by a list of keys with values, starting with -
and containing a :
to associate values.
Automatically recognised if value is only true
or false
.
Automatically recognised if value is only an integer
or float
.
#! data.huml
- huml : is a markup language
- lang : is easy
- reasons :
- simple
- natural
- obvious
- therefore :
- developers : true
- non-developers : true
- dogs : false
- difficulty : no way, this is super easy!
// index.js
const huml = require('huml');
const read = require('fs').readFile;
read('./path/to/data.huml', (err, data) => {
if ( err )
{
throw err;
}
const config = huml(data);
console.log(config);
});