{"_id":"helper-yaml","_rev":"3-a8d527d14e4b2f293cb61472ca182adf","name":"helper-yaml","description":"Template helper for parsing YAML from a string.","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"helper-yaml","description":"Template helper for parsing YAML from a string.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/helper-yaml","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/helper-yaml.git"},"bugs":{"url":"https://github.com/jonschlinkert/helper-yaml/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/helper-yaml/blob/master/LICENSE"},"files":["index.js","js-yaml.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","copy":"cp 'js-yaml/dist/js-yaml.js' 'js-yaml.js'","clone":"git clone git://github.com/nodeca/js-yaml.git","remove":"rm -rf js-yaml","update":"npm run clone && npm run copy && npm run remove"},"devDependencies":{"engine-handlebars":"^0.6.1","esprima":"^2.2.0","handlebars":"^3.0.3","helper-read":"^0.1.0","lodash":"^3.8.0","mocha":"^2.2.4","should":"^6.0.1","template":"^0.14.0"},"keywords":["helper","template","yaml"],"_id":"helper-yaml@0.1.0","_shasum":"897b1893f80dba02dc6a856a3cb3098db426d926","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"897b1893f80dba02dc6a856a3cb3098db426d926","tarball":"https://registry.npmjs.org/helper-yaml/-/helper-yaml-0.1.0.tgz","integrity":"sha512-VE8Oqxl19nuSxShTcbbyoKoOazTCm4+9R74ooQnP85X/tTSrK0ubZG+fg6HBHQuRtSYt/1BRiFvJogwSm8X7PA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxfXmu6+jkD4SCFA3umzR8SfpPSndgX/xWgJ5Ols9qxgIgMz3xSQikIlXneRB6l8TqD9/j5gV7S3JIdX6V5VmXE0Y="}]}}},"readme":"# helper-yaml [![NPM version](https://badge.fury.io/js/helper-yaml.svg)](http://badge.fury.io/js/helper-yaml)\n\n> Template helper for parsing YAML from a string.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```bash\nnpm i helper-yaml --save\n```\n\n## Usage\n\n```js\nvar yaml = require('helper-yaml');\n```\n\n**Usage with [handlebars]**\n\n```js\nvar handlebars = require('handlebars');\nhandlebars.registerHelper('yaml', yaml.sync);\n\nhandlebars.compile('{{{yaml \"name: Halle\\nage: 4\\n\"}}}')();\n//=> {first: 'Halle', age: 4}\n```\n\n**Usage with [Template](https://github.com/jonschlinkert/template)**\n\n```js\nvar yaml = require('helper-yaml');\nvar Template = require('template');\nvar template = new Template();\n\n/**\n * Register an engine\n */\n\ntemplate.engine('foo', require('engine-handlebars'));\n\n/**\n * Register the helper\n */\n\ntemplate.asyncHelper('yaml', yaml);\ntemplate.helper('stringify', function (o) {\n  return JSON.stringify(o);\n});\n\n/**\n * Add some templates\n */\n\n// note that JSON.stringify and JSON.parse are only\n// necessary here since I'm defining the YAML string inline.\n// If it's passed as a variable JSON.parse/stringify aren't needed\ntemplate.page('abc.foo', '{{{stringify (yaml \"first: Halle\\nlast: Schlinkert\\n\")}}}');\ntemplate.page('xyz.foo', '{{{stringify (yaml \"first: Brooke\\nlast: Schlinkert\\n\")}}}');\n\n/**\n * Render the templates\n */\n\ntemplate.render('abc.foo', function (err, res) {\n  if (err) console.log(err);\n  console.log(JSON.parse(res));\n  //=> { first: 'Halle', last: 'Schlinkert' }\n});\n\ntemplate.render('xyz.foo', function (err, res) {\n  if (err) console.log(err);\n  console.log(JSON.parse(res));\n  //=> { first: 'Brooke', last: 'Schlinkert' }\n});\n```\n\n## Related projects\n\n* [assemble](http://assemble.io): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](http://assemble.io)\n* [template](https://github.com/jonschlinkert/template): Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… [more](https://github.com/jonschlinkert/template)\n* [template-helpers](https://github.com/jonschlinkert/template-helpers): Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… [more](https://github.com/jonschlinkert/template-helpers)\n* [verb](https://github.com/assemble/verb): Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… [more](https://github.com/assemble/verb)\n\n## Running tests\n\nInstall dev dependencies:\n\n```bash\nnpm i -d && npm test\n```\n\n## Update js-yaml\n\n```sh\n% npm run update\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/helper-yaml/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright (c) 2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 12, 2015._","maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-18T20:08:33.674Z","created":"2015-05-12T04:17:50.471Z","0.1.0":"2015-05-12T04:17:50.471Z"},"homepage":"https://github.com/jonschlinkert/helper-yaml","keywords":["helper","template","yaml"],"repository":{"type":"git","url":"git://github.com/jonschlinkert/helper-yaml.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/helper-yaml/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/helper-yaml/blob/master/LICENSE"},"readmeFilename":"README.md"}