Website/node_modules/yaml-js
2015-12-04 02:31:39 -05:00
..
lib Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
src Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
test Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
.gitmodules Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
.npmignore Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
Cakefile Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
package.json Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
README.md Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
yaml.js Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00
yaml.min.js Paper rendering works, and news fields get populated correctly now. 2015-12-04 02:31:39 -05:00

yaml-js

yaml-js is currently a YAML loader, and eventually a YAML dumper, ported pretty much line-for-line from PyYAML. The goal is to create a reliable and specification-complete YAML processor in pure Javascript. You can try it out here.

Current Status

Currently loading works well, and passes the yaml-spec test suite.

If you use the library and find any bugs, don't hesitate to create an issue.

How Do I Get It?

npm install yaml-js

How Do I Use It?

In node (CoffeeScript):

yaml = require 'yaml-js'
console.log yaml.load '''
  ---
  phrase1:
    - hello
    - &world world
  phrase2:
    - goodbye
    - *world
  phrase3: >
    What is up
    in this place.
'''
# { phrase1: [ 'hello', 'world' ],
#   phrase2: [ 'goodbye', 'world' ],
#   phrase3: 'What is up in this place.' }

In the browser:

<script src='yaml.min.js'></script>
<script>
  console.log(yaml.load('hello: world'));
  // { 'hello' : 'world' }
</script>

License

WTFPL