2.0.1 • Published 5 years ago
js-yaml-pack v2.0.1
js-yaml-pack
Generates a *.json
file based on a *.yaml
file given as an input. It extends the js-yaml package by allowing to convert multiple documents to generate the json object.
Usage
Try the example: create a main.js
and copy this code below. Keep in mind that fs
module doesn't work in the browser for security reasons.
var test = require('js-yaml-pack') // require the js-yaml-pack package
var fs = require('fs')// you need to require this module or package to read local
var storedObject = test.yaml2json(fs.readFileSync(<path to a yaml file>));
console.log(storedObject)
js-yaml-pack
doesn't process strings, so it should be receive raw text files unquoted.
License
Apache 2.0