A Twitch.tv viewer reward and games system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
13 KiB

11 years ago
  1. {
  2. "name": "mustache",
  3. "version": "0.7.2",
  4. "description": "Logic-less {{mustache}} templates with JavaScript",
  5. "author": {
  6. "name": "mustache.js Authors",
  7. "email": "http://github.com/janl/mustache.js"
  8. },
  9. "keywords": [
  10. "mustache",
  11. "template",
  12. "templates",
  13. "ejs"
  14. ],
  15. "main": "./mustache.js",
  16. "devDependencies": {
  17. "mocha": "1.5.0"
  18. },
  19. "volo": {
  20. "url": "https://raw.github.com/janl/mustache.js/0.7.2/mustache.js"
  21. },
  22. "scripts": {
  23. "test": "mocha test"
  24. },
  25. "readme": "# mustache.js - Logic-less {{mustache}} templates with JavaScript\n\n> What could be more logical awesome than no logic at all?\n\n[mustache.js](http://github.com/janl/mustache.js) is an implementation of the [mustache](http://mustache.github.com/) template system in JavaScript.\n\n[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object.\n\nWe call it \"logic-less\" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.\n\nFor a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html).\n\n## Where to use mustache.js?\n\nYou can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [node](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views.\n\nmustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD.\n\n## Who uses mustache.js?\n\nAn updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js!\n\n## Usage\n\nBelow is quick example how to use mustache.js:\n\n var view = {\n title: \"Joe\",\n calc: function () {\n return 2 + 4;\n }\n };\n\n var output = Mustache.render(\"{{title}} spends {{calc}}\", view);\n\nIn this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template.\n\n## Templates\n\nA [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key.\n\nThere are several types of tags available in mustache.js.\n\n### Variables\n\nThe most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered.\n\nAll variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable.\n\nView:\n\n {\n \"name\": \"Chris\",\n \"company\": \"<b>GitHub</b>\"\n }\n\nTemplate:\n\n * {{name}}\n * {{age}}\n * {{company}}\n * {{{company}}}\n * {{&company}}\n\nOutput:\n\n * Chris\n *\n * &lt;b&gt;GitHub&lt;/b&gt;\n * <b>GitHub</b>\n * <b>GitHub</b>\n\nJavaScript's dot notation may be used to access keys that are properties of objects in a view.\n\nView:\n\n {\n \"name\": {\n \"first\": \"Michael\",\n \"last\": \"Jackson\"\n },\n \"age\": \"RIP\"\n }\n\nTemplate:\n\n * {{name.first}} {{name.last}}\n * {{age}}\n\nOutput:\n\n * Michael Jackson\n * RIP\n\n### Sections\n\nSections render blocks of text one or more times, depending on the value of the key in the current context.\n\nA section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's \"block\".\n\nThe behavior of the section is determined by the value of the key.\n\n#### False Values or Empty Lists\n\nIf the `person` key does not exist, or exists and has a value of `null`, `undefined`, or `false`, or is an empty list, the block will not be rendered.\n\nView:\n\n {\n \"person\": false\n }\n\nTemplate:\n\n Shown.\n {{#person}}\n Never shown!\n {{/person}}\n\nOutput:\n\n
  26. "readmeFilename": "README.md",
  27. "_id": "mustache@0.7.2",
  28. "dist": {
  29. "shasum": "788c1e1f8af9c3c992ad5f6103aa3df7a029dfb7"
  30. },
  31. "_from": "mustache"
  32. }