YAML parser that preserves comments and styling
import YAWN from 'yawn-yaml';
let str = `
# my comment
value: 1 # the value is here!
`;
let yawn = new YAWN(str);
// update the `json` property
yawn.json = { value: 2 };
// value in `yawn.yaml` is now changed.
// with comments and styling preserved.
console.log(yawn.yaml); // =>
// # my comment
// value: 2 # the value is here!
Use npm or yarn to install yawn-yaml
package
npm install --save yawn-yaml
yarn add yawn-yaml
To install dependencies run:
yarn install
To run tests continuously and watch for changes
yarn start
To run the test run:
yarn test