datta
A readable plain text structure for strictly formatted data
Installation
npm i datta
Usage
var datta = var str = datta var obj = datta
You can also require just a single method:
var stringify = var parse =
API
stringify(obj)
Accepts a single object
. Returns a string
.
parse(str)
Accepts a single string
. Returns an object
.
Structure
The header contains the names of the fields that are separated by spaces. The spaces define the max length of the value.
The ---
separates the header from the content.
The content forms columns (every field begins where its name is in the header). The last column is basically doesn't have defined length.
Lines beginning with #
are comments.