{
  "name": "js-yaml",
  "version": "1.0.3",
  "description": "YAML 1.1 Parser",
  "keywords": [
    "yaml",
    "parser",
    "pyyaml"
  ],
  "homepage": "https://github.com/nodeca/js-yaml",
  "author": {
    "name": "Aleksey V Zapparov",
    "email": "ixti@member.fsf.org",
    "url": "http://www.ixti.net/"
  },
  "contributors": [
    {
      "name": "Martin Grenfell",
      "email": "martin.grenfell@gmail.com",
      "url": "http://got-ravings.blogspot.com"
    }
  ],
  "bugs": {
    "url": "https://github.com/nodeca/js-yaml/issues"
  },
  "license": {
    "type": "MIT",
    "url": "https://github.com/nodeca/js-yaml/blob/master/LICENSE"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/nodeca/js-yaml.git"
  },
  "main": "./index.js",
  "bin": {
    "js-yaml": "bin/js-yaml.js"
  },
  "scripts": {
    "test": "make test"
  },
  "dependencies": {
    "argparse": "~ 0.1.3"
  },
  "devDependencies": {
    "vows": "~ 0.6.0"
  },
  "engines": {
    "node": ">= 0.6.0"
  },
  "readme": "JS-YAML - YAML 1.1 parser for JavaScript\n========================================\n\n[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml)\n\n[Online Demo](http://nodeca.github.com/js-yaml/)\n\nThis is a native port of [PyYAML](http://pyyaml.org/), the most advanced YAML parser.\nNow you can use all modern YAML feature right in JavaScript. Originally snapshoted\nversion - PyYAML 3.10 (2011-05-30).\n\n\n## Breaking changes in 0.3.x -> 1.0.x\n\n- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore.\n  Decision to drop support of such \"magic\" was made after speaking with YAML\n  core developers: from now on we try to keep as minimal subset of rules as\n  possible to keep things obvious. Booleans are following YAML 1.2 core schema\n  now: http://www.yaml.org/spec/1.2/spec.html#id2804923\n- `require('file.yml')` now returns a single document (was array of documents)\n  and throws an error when file contains multiple documents. That should improve\n  switching between YAML <-> JSON. So `require('file.yml')` will give the same\n  result as if it was `require('file.json')` now.\n- CLI tool `js-yaml` become part of `js-yaml` again.\n\n\n## Installation\n\n### YAML module for node.js\n\n```\nnpm install js-yaml\n```\n\n\n### CLI executable\n\nIf you want to inspect your YAML files from CLI, install js-yaml globally:\n\n```\nnpm install js-yaml -g\n```\n\n##### Usage\n\n    usage: js-yaml [-h] [-v] [-c] [-j] [-t] file\n\n    Positional arguments:\n      file           File with YAML document(s)\n\n    Optional arguments:\n      -h, --help     Show this help message and exit.\n      -v, --version  Show program's version number and exit.\n      -c, --compact  Display errors in compact mode\n      -j, --to-json  Output a non-funky boring JSON\n      -t, --trace    Show stack trace on error\n\n\n\n### bundled YAML library for browser\n\n``` html\n<script src=\"js-yaml.min.js\"></script>\n<script type=\"text/javascript\">\nvar doc = jsyaml.load('greeting: hello\\nname: world');\n</script>\n```\n\nBrowser support is still buggy, and mostly done to run online demo. If you\ncan help to improve browser compatibility and AMD support - rise pull request.\n\n**Support of oldIEs** and some other prehistoric browsers is possible using\n[es5-shims](https://github.com/kriskowal/es5-shim). Just include shims before\njsyaml to use it with outdated browsers.\n\n\n## API\n\nJS-YAML automatically registers handlers for `.yml` and `.yaml` files. You can load them just with `require`.\nThat's mostly equivalent to calling loadAll() on file handler ang gathering all documents into array.\nJust with one string!\n\n``` javascript\nrequire('js-yaml');\n\n// Get document, or throw exception on error\nvar doc = require('/home/ixti/example.yml');\n\nconsole.log(doc);\n```\n\n\n### load (string|buffer|file\\_resource)\n\nParses source as single YAML document. Returns JS object or throws exception on error.\n\nThis function does NOT understands multi-doc sources, it throws exception on those.\n\n``` javascript\nvar yaml = require('js-yaml');\n\n// pass the string\nfs.readFile('/home/ixti/example.yml', 'utf8', function (err, data) {\n  if (err) {\n    // handle error\n    return;\n  }\n  try {\n    console.log( yaml.load(data) );\n  } catch(e) {\n    console.log(e);\n  }\n});\n```\n\n\n### loadAll (string|buffer|file\\_resource, iterator)\n\nSame as `Load`, but understands multi-doc sources and apply iterator to each document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\n// pass the string\nfs.readFile('/home/ixti/example.yml', 'utf8', function (err, data) {\n  if (err) {\n    // handle error\n    return;\n  }\n\n  try {\n    yaml.loadAll(data, function (doc) {\n      console.log(doc);\n    });\n  } catch(e) {\n    console.log(e);\n  }\n});\n```\n\n\n### safeLoad (string|buffer|file\\_resource)\n\nSame as `load()` but uses _safe_ schema - only recommended tags of YAML\nspecification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### safeLoadAll (string|buffer|file\\_resource, iterator)\n\nSame as `loadAll()` but uses _safe_ schema - only recommended tags of YAML\nspecification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n## JavaScript YAML tags scheme\n\nThe list of standard YAML tags and corresponding JavaScipt types. See also\n[YAML Tag Discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and [Yaml Types](http://yaml.org/type/).\n\n```\n!!null ''                   # null\n!!bool 'yes'                # bool\n!!int '3...'                # number\n!!float '3.14...'           # number\n!!binary '...base64...'     # buffer\n!!timestamp 'YYYY-...'      # date\n!!omap [ ... ]              # array of key-value pairs\n!!pairs [ ... ]             # array or array pairs\n!!set { ... }               # array of objects with given keys and null values\n!!str '...'                 # string\n!!seq [ ... ]               # array\n!!map { ... }               # object\n```\n\n**JavaScript-specific tags**\n\n```\n!!js/regexp /pattern/gim            # RegExp\n!!js/undefined ''                   # Undefined\n!!js/function 'function () {...}'   # Function\n```\n\n### Caveats\n\nNote, that you use arrays or objects as key in JS-YAML. JS do not allows objects\nor array as keys, and stringifies them at the moment of adding them.\n\n``` yaml\n---\n? [ foo, bar ]\n: - baz\n? { foo: bar }\n: - baz\n  - baz\n```\n\n=>\n\n``` javascript\n{ \"\": [\"baz\"], \"[object Object]\": [\"baz\", \"baz\"] }\n```\n\n## License\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file (MIT).\n",
  "readmeFilename": "README.md",
  "_id": "js-yaml@1.0.3",
  "_from": "js-yaml@~1.0.1"
}
