[
  {
    "path": "MIT-LICENSE",
    "content": "Copyright 2014 Tomasz Mazur, Jacek Becela\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "nano.js",
    "content": "/* Nano Templates - https://github.com/trix/nano */\n\nfunction nano(template, data) {\n  return template.replace(/\\{([\\w\\.]*)\\}/g, function(str, key) {\n    var keys = key.split(\".\"), v = data[keys.shift()];\n    for (var i = 0, l = keys.length; i < l; i++) v = v[keys[i]];\n    return (typeof v !== \"undefined\" && v !== null) ? v : \"\";\n  });\n}\n"
  },
  {
    "path": "readme.md",
    "content": "NANO - Simplest Template Engine\n=============================\n\n***Basic Usage***\n\nAssuming you have following JSON response:\n\n<pre>\ndata = {\n  user: {\n    login: \"tomek\",\n    first_name: \"Thomas\",\n    last_name: \"Mazur\",\n    account: {\n      status: \"active\",\n      expires_at: \"2009-12-31\"\n    }\n  }\n}\n</pre>\n\nyou can make:\n\n<code>\n  nano(\"&lt;p&gt;Hello {user.first_name} {user.last_name}! Your account is &lt;strong&gt;{user.account.status}&lt;/strong&gt;&lt;/p&gt;\", data)\n</code>\n\nand you get ready string:\n\n<code>\n  &lt;p&gt;Hello Thomas Mazur! Your account is &lt;strong&gt;active&lt;/strong&gt;&lt;/p&gt;\n</code>\n\nTest page: <a href=\"testPage.html\">testPage.html</a>\n\nSimple huh?\n\n***More Advanced Example***\n\n\nDisplaying list of twitter search results (JSONP API)\n\nhttp://jsfiddle.net/UXZDy/86/\n"
  },
  {
    "path": "testPage.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>Test page for nano</title>\n    <!-- include lib -->\n    <script type=\"text/javascript\" src=\"nano.js\"></script>\n\n    <!-- test data -->\n    <script type=\"text/javascript\">\n        data = {\n            user: {\n                login: \"tomek\",\n                first_name: \"Thomas\",\n                last_name: \"Mazur\",\n                account: {\n                    status: \"active\",\n                    expires_at: \"2009-12-31\"\n                }\n            }\n        }\n    </script>\n\n</head>\n<body>\n\n\n<p id=\"testLayout\">nano(\"&lt;p&gt;Hello {user.first_name} {user.last_name}! Your account&nbsp;is &lt;strong&gt;{user.account.status}&lt;/strong&gt;&lt;/p&gt;\", data)</p>\n\n\n<script type=\"text/javascript\">\n    window.onload = function () {\n        document.getElementById('testLayout').innerHTML = nano(\"<p>Hello {user.first_name} {user.last_name}! Your account is <strong>{user.account.status}</strong></p>\", data);\n    }\n</script>\n</body>\n</html>"
  }
]