1.5.0-fork.1 • Published 4 years ago
@gr2m/yawn-yaml v1.5.0-fork.1
YAWN YAML
YAML parser that preserves comments and styling
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-yamlbower install --save yawm-yamlIf you wish to depend to ES6 version use src/index.js file.
Development
To install dependencies run:
npm installTo run the test run:
npm testTo run tests continuously and watch for changes install mocha and run:
mocha --compilers js:babel/register -wTo make a new build run:
npm run browserifyLicense
1.5.0-fork.1
4 years ago
1.5.0
4 years ago