oyaml

0.1.5 • Public • Published

OYAML: One-line YAML

OYAML is a YAML-like notation syntax for objects with very flexible whitespace. It's relatively human-readable and human-writable, while being compatible with a one-line-per-record data format, much like JSON Lines.

Installation

npm install oyaml

Usage

const { parse, stringify } = require('oyaml')
 
const str = 'message:hi "longer message":"Hello there!" number:4.3 list:[a, b, thing:stuff]'
const obj = parse(str)
/** 
{
  "message": "hi",
  "longer message": "Hello there!",
  "number": 4.3,
  "list": [
    "a",
    "b",
    {
      "thing": "stuff"
    }
  ]
}
**/
 
const oyaml = stringify(obj)
// message:hi "longer message":"Hello there!" number:4.3 list:[a, b, thing:stuff]

Readme

Keywords

Package Sidebar

Install

npm i oyaml

Weekly Downloads

13

Version

0.1.5

License

MIT

Unpacked Size

343 kB

Total Files

16

Last publish

Collaborators

  • jkriss