YAML parser that preserves comments and styling
JavaScript HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode Add .vscode ot repo Nov 24, 2015
cjs add get and set remark api Apr 20, 2018
demo
dist
src add get and set remark api Apr 20, 2018
test
.eslintignore Setup eslint Sep 23, 2015
.eslintrc add get and set remark api Apr 20, 2018
.gitignore
.travis.yml
LICENSE Add license Sep 23, 2015
README.md
bower.json
index.html
jsconfig.json Add .vscode ot repo Nov 24, 2015
package.json
playground.html Work in progress Sep 24, 2015

README.md

YAWN YAML

Build Status

YAML parser that preserves comments and styling

Live Demo

Usage

// If you use ES2015 modules
import YAWN from 'yawn-yaml';

// If you use CommonJS modules
const YAWN = require('yawn-yaml/cjs')

let str = `
# my comment
value: 1 # the value is here!
`;

let yawn = new YAWN(str);

yawn.json = {value: 2};


// value in `yawn.yaml` is now changed.
console.log(yawn.yaml); // =>
// # my comment
// value: 2 # the value is here!

Installation

Use npm or Bower to install "yawn-yaml" package

npm install --save yawn-yaml
bower install --save yawm-yaml

If you wish to depend to ES6 version use src/index.js file.

Development

To install dependencies run:

npm install

To run the test run:

npm test

To run tests continuously and watch for changes install mocha and run:

mocha --compilers js:babel/register -w

To make a new build run:

npm run browserify

License

MIT