lsd-parser

0.0.2 • Public • Published

Loose Structured Data

Parses strings like:

name: Al, grape: "green", 'banana'='not at all'
{value=23.1; 2: átila the hun}
{'ninjá'=23.12a    ; 23=1  ;}
g=true,f:false,l:null;     null    :   false   ,true:23,false:'true' ;
{"fruits"=['banana', 1235.2] ; other fruits:   [ 77,'crazy',"y!@#@#%¨&*" ,];}

To sane data. In fact it gives you arrays of key-values, like [['name', 'Al'], ['grape', 'green']], but you can easily turn those into Javascript objects, if you want.

It supports numbers, booleans and null as keys. It can also parse normal JSON, but only if there's only one level of key-value pairs (the problem with lack of clear syntax is that).

See test.js for a better figure of what exactly it does (nothing that it is not said here).

We're on npm: https://www.npmjs.com/package/lsd-parser We're on Travis CI: https://travis-ci.org/fiatjaf/LSD

Package Sidebar

Install

npm i lsd-parser

Weekly Downloads

4

Version

0.0.2

License

MIT

Last publish

Collaborators

  • fiatjaf