Giter Site home page Giter Site logo

kevinswiber / yawn-yaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohsen1/yawn-yaml

0.0 2.0 1.0 1.47 MB

YAML parser that preserves comments and styling

Home Page: http://azimi.me/yawn-yaml/demo/index.html

License: MIT License

JavaScript 98.95% HTML 1.05%

yawn-yaml's Introduction

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

yawn-yaml's People

Contributors

mohsen1 avatar loilo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.