{"_id":"urza","_rev":"154-d31e86007b9625f080f15fe3ad6f1863","name":"urza","description":"Urza is a node.js framework built for rapid development.","dist-tags":{"latest":"0.1.10"},"versions":{"0.0.1":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.1","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"~0.6.11 || 0.6.11-pre"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.1","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"42656f6121c0a360273a413256091a46c90002ba","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.1.tgz","integrity":"sha512-NZXVFkORvXYlcJcN3dHgV0DZsth1nRURYp+RGmUmPw0Pa+V+y8RBcZC3H7WXFCdgv8PhxxUg0R426fXuvPnf9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjUE500cBYZyJ4eSMRgyzh0w1NJuj4YjHGxcTdeZCs+AiAEuz/j1x2XBo/Hdlp/qYZUTcwW0Fxqv0+aExhPh+FMoQ=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.2":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.2","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"~0.6.11 || 0.6.11-pre"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.2","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"be49032ff9cc3cc5b5566911b20085294740621a","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.2.tgz","integrity":"sha512-dB/6f8HnaK3A4kLUncHrla3k9NlbgijecV/cgv8lIOFlbtkt3ifi6LaT34yUU0UQ54E28j64VC8ScHaeqxO4TQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnwAnB0O4LMXlJgii7+4DbV7kCZ/kvIy43eSTXI07XLQIhAIn5Jq6DK9MOVI3mKKu7L9bRO8ByUGBj8a0FVLqEsEs9"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.2-1":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.2-1","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"~0.6.11 || 0.6.11-pre"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.2-1","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"01adea24ebcbb641f345823812e22ed0373c808f","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.2-1.tgz","integrity":"sha512-LNYPszk9Jl5tp7vICFCjU7RcFCC5jjPUBpkPCXbPwXs4EqBLRPsHnoGd/D0Pt8ZrwbwsQ4eNkgr05jPUy1gYvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDorr1lhf2iQNLFtJEstdKbqNsdTFJBbHx+yHe1ouLWgIhAJ5/8FKErOCkKTTUGGIqKOzlVlle+rLaVS17oz8172ro"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.2-2":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.2-2","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"~0.6.11 || 0.6.11-pre"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.2-2","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"7ac182370c2a3360a8721a693da530611a5f0a0f","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.2-2.tgz","integrity":"sha512-KuvqW721o6K7rHj5tMXT5pwJtzx2pv3OYrvYFBBbRgcXIydUzGJn6eb/lwlzbIDfuGEPnlXT/pS1BYl3+b3tmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlEepeAc+oTt77tfdLomhXNY2bWCzaWZcuXjnS4FZtGAiEAqDw7ZOKrw4Qm6hnRQLp8e45AQEPwJDpQcfFlSoBcHzg="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.2-3":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.2-3","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"~0.6.11 || 0.6.11-pre"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.2-3","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"9c322184fc7a2696e3e2ab71ad8c8b1e0d52ac40","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.2-3.tgz","integrity":"sha512-hr79vAU7mNTDbPkhblXWp4Q6mpCsGWgjVd/Mr1MCmmB6WlnVKt8WfkqH8SM9MVfUz1fjn+vqWegFLjXqr/oeJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9OqdRolI7PNuYAl29XM0r6nFLfAJU7OOLggp0Abfo1wIhAKylykGelnU421P7XLK8oHPvamuUMrb63sEKv9jHC1mB"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.2-4":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.2-4","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.2-4","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"ce42060f387e7cdc3e7e12890fb5879745de0eac","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.2-4.tgz","integrity":"sha512-wrhqfYI+nMN1pwltcASp9GqrtV1XX1hJBmrulIGXnNwEwVjoZVcLWJvSy5c6DmywECY1rQJ/b3blLMiCn9sr6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4ctwbDtDpIksrv3YLw9EtACyIglEMq01pYcAszXodDAIgfwoXvB8SFNKrZENZhZew46H7lpryBrjqipVQszQ19JA="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.25":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.25","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.25","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"f114ace7ce6a1272c749d4910eafa6e6d089c6df","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.25.tgz","integrity":"sha512-qDUWm/LhrwJG1GHDBY2vYhR9d4lNXglKm9UlSmVAYCGTqVeWIdyiCrDFz9sinJ+msq2iA9betaAYEkeJukRjVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6AcB14BXDRaiGCqsNOMKP/4L8YYOja56xv/ARjR00aQIhAPSqUGmd7pHjx4xqa4WklTh8E9ZWRSnEqx1mFQltXNjR"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.26":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.26","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.26","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"d33b1d7de8e872765e5839a491d26e947c1bac3b","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.26.tgz","integrity":"sha512-REFlvUOwvSfAspSBGrU31zaBNRvn6sN1oimM+vULMwWIZPS4lIkNjnZscOnW2C96XSeSwZOzw4sqPuxqzGBl9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYqqCNxY8KP+TaT5rtdF+uLuI8B0YJeMnP02UbABs0hAiEAkyQzsvvTcJoOwXaP0TAcxWPAl/I2rrYWPzQSL8DDvFE="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.28":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.28","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.28","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"7f821bdc80e26d50aacebc98bda01dd7c56d95e4","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.28.tgz","integrity":"sha512-lb0oUxdhDpOkOd+9p275XxgAZU559+KSXyE7IRf4LT4IcrQlv3sZsSakuMjgUlDjtS5Yn8QwrL/7PLB8zxbB/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG//N9wiIzFEv3feuiqNyMJvM7+N6kbHARdO9jX6LeVhAiEAvIC3f/zhQsscEvAmGy39X9wYwWF+Ltrc4CKtBpQrp2Y="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.29":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.29","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.29","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"646acf303d1d4bcf1151214a75d48daaa8d2e9f0","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.29.tgz","integrity":"sha512-OrzsHDSdNzr/qvwsHEURtSo9Zeo2daaDqy7GrUYfCambDHePUAtjIHvVHseBXY8PtZCtGKkTRxPpSIp55U1PjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyQAHSYhksqjF/NqZ5JG8zSJsHUQE5Pk+5NXoDuBWbQQIhANX6D0TfT24C+0I7f9ifAyNfLQO+hwJ+gFkUrY9FA7dd"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.30":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.30","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.30","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"e3f39d396ff358f64fec052a80761670e1399ab6","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.30.tgz","integrity":"sha512-HDs09bWXiz/xEivHAZy50doQycEd6PrwkJesJQ1jPN1GgJINsbTL3qJ+P9eEwGHNiNaZvI0fh9m1AJuILmgg5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhUoTS1L/1OsPkr7LYeMMJoTmSZWg13H9oyMiBVqjosAiAnMz0wuiI67b9Diq2XqrMFnzEPAveavSEu9rTSvGYawQ=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.4":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.4","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.4","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"39d563ffc8530fe5db2dddbe4af8b3f06dc0ac10","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.4.tgz","integrity":"sha512-dMjRBE0Tjg4Rm66CPVMPzy5EfW5M1VbfhJILogLiptcj+P0QrMqRQ09/zzlPRxIpWpsYS4pqXc+yUll0PSHuAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmQa+R0IoORUImFN/oKALHfidvFFoxnp/RjLJllanRwAIhAK/PSJjKDM3yqs42RoLoJf75OP+myG8b42GzKFJ60W2P"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.0.5":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.0.5","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"1.3.x","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.0.5","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"fa82829e0588bd8c3976aaf610c5b5fe08220025","tarball":"https://registry.npmjs.org/urza/-/urza-0.0.5.tgz","integrity":"sha512-20saIT3gi953q/L8RoO6nycRPEjgJ2pPQEfxGokQDLhQxycjyJbFfakX/wAnK1s5p4lZ0jSVozQJeDc4oNsAMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGATp+I8baXXf50IHOnd/A5a2yE0Ab+7uokUjuz7mB3TAiBbfkGvvgUty6YCoPLkLdnvWZOqZfukELubi1qgNWYLfQ=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.0a":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.0a","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"_npmUser":{"name":"jesseditson","email":"jesse.ditson@gmail.com"},"_id":"urza@0.1.0a","_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.12-pre","_defaultsLoaded":true,"dist":{"shasum":"b02654e1385d5f4755fcc0ca648327a225adb5bc","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.0a.tgz","integrity":"sha512-hboL/fS2gsuaScWXpVsDIh1b4Z3zPXlDg3ke8QrDFNQ/UBfAtoSA1Ab8UKUZalmNrSY9WfFsKkDIxXEfojgSBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJtTg7bsFyyKmNzyRHgdX4yHsU8wzZMbkK8w68jjRd9AiAgZGaHSfJwBjKO5vu9cmGMfC6LvDS5RRKIXPVm+Z016A=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.3a":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.3a","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config":"0.4.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.3a","dist":{"shasum":"f28988691eb65990634e948f90285fae8059e051","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.3a.tgz","integrity":"sha512-zwokyGLaE5E8OefDosRwNyRsD6050zQl8+A7DNlkVfg0v96cLcN4ffNuiGXvs6WlegH/yADjrEWdtyOWMMw3Ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMOIVIE+zv7V2aMV2n3lkYnZsypirIKLMCIUhUi5yfkwIge9CJMp+5vpnpN2AVBrBLYXFohLjgwGQRpUmYlFq6b+Q="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.4a":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.4a","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.4a","dist":{"shasum":"3424714530b9c0ac7515de9663db219694c57833","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.4a.tgz","integrity":"sha512-bdvowse452WbPyJB+s3t9q8Rc0therhOyVJdgybTFdBA8w5e4oVtqcOvQ63w9NwnRLNs47IQ9ncRvw8omqpI/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe9hY0P1y3zsYz4Zwyp/jNoAn6Kvt/GNt8/UpvaAXODQIgNosGHGNzq5510i3ktAMOwl+wEFeGb709iX/LxftoMnk="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.4":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.4","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"0.3.x","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.4","dist":{"shasum":"ff294c1b888effe61128d2c148be63826e62d403","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.4.tgz","integrity":"sha512-gCncr0QYVpD4bUF577Qbxy4rmtlXpftSsiNVEVN2zdKQfV8y4OEgIa2BBZbWhbAjObINRwosM9tflz8lvl/Q8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHyu5PBuW4oo40s8BDR+8RWrLifoTDPz4UobZq2V0ysZAiEAlJrud/t+xuDxG6srRgOAHbnfBpg4EEYGRw5SIx5xdpY="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.4-1":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.4-1","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.4-1","dist":{"shasum":"e548b42cd376dcac96db91e4c1ff02d2e4232c47","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.4-1.tgz","integrity":"sha512-6myDAoSm/uecb/RK2UioFTMbdgInQ/GJs1yyf9wJdfvK6thet8O8HJPOB06xT0x6UBs6i6Mavu+xATVWM1VLfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCLD23erZSM4+iV2/xtIhxJuyu91Qp6ME5Bga9JmowrwIhAIVZ0Yar8khNICnnVi3wpi5qkshgofwRdUQkn5cOTw5d"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.4-2":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.4-2","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.4-2","dist":{"shasum":"d4e509605f44bbe286822f0823062605208e5ab9","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.4-2.tgz","integrity":"sha512-UNTYhexxk4F5J+YXn33rr99fpRWa3W1PSunR6oYK/rqYKltvVl1KZRmDo/R2BuVz4omLgHJV/vrLCRO2ziE8ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdnQWRBqr/Z4XjdDsLO3Zg8Ou02NrNPJBoOFjjZSc8pQIhAMSPNK9TNzUUpdz+0WVMSup3FnqLqgBmbKqED81oGUm5"}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.5":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.5","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.5","dist":{"shasum":"80780d597a26047b1ae93e5b22e6270888f2cbe4","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.5.tgz","integrity":"sha512-s3P1sEg/1QO18Y7BzX66s2tOwXCunZAlmGdpJdvk9ZvGwzZXFYOBubImDWFMA0Ck/I/RopWBIUoQZ89NdR9+5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsM/K8CGiOw76i852+jAOnv6OvgFwWgMBdp07jKN0C2AiAe2f89a8dchPV3jB/rIXwAHoJni4aZD3adAkiOUzB/1g=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.6":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.6","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0","grunt-css":"~0.2.1"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.6","dist":{"shasum":"22a1e283c3b49a130332c927a66cc77154e56406","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.6.tgz","integrity":"sha512-kRqjQKNFcnCrUXF6ksLeWNsZh0l8McCDvUczd3EeWQi6Iq/AfDGFbLvgBlqxEIsLq0lsdohtK4HNJJjRuFyeNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7GdB4NFxXRTtXpxvCC3KGFIiHejU3bglxsDsc/NcaCAiBityh+IseEgHOuJkpWSXZmNrY6MvdXr8GEvY8weHNdlw=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.7":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.7","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0","grunt-css":"~0.2.1"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.7","dist":{"shasum":"697bae93ea7d4144fb5357cb507e34f955fa52f5","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.7.tgz","integrity":"sha512-Djc5NQ3u6E9r5yZ8ZADI65rhUX7yhRGJMAeWH6j9UxvJ8UM5wG+Y2wpiKp3gXTWcmjgGAmzUWtLMDdNzsYcCrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmkagl0ZEzIwNEaJlP5R4gZkA4O9lCa2ssFnm7x46A2AiBGIYqhilmNnRpNY5InvhgSgoFVTcPuQJx/2bHTDNe0nA=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.8":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.8","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0","grunt-css":"~0.2.1"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.8","dist":{"shasum":"b8406fe3b7b22174943c7ca5e5262acfaebd4e7e","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.8.tgz","integrity":"sha512-SJZRNgV5BHOOST28aKt/1J2n9ro6LjsGoI/D5fFry3gGZmlZ3ZZzpjhYZixV1RYcmHM8kr5/mKjUvvzBpNTtDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFDknShhykt1geSreHywfhqWhTykKyCmJXe2Mb2EVK7/AiAQFMxKeaq4Gd9qAitzDjrbm6U8oVVjjVZeW/Fqo/5m8w=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.9":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.9","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0","grunt-css":"~0.2.1"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.9","dist":{"shasum":"ece48b4c9fa713d52b7a6dfc147cfbab892fe73e","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.9.tgz","integrity":"sha512-84OLHsUpyA6PYKY+/qwUhfRjFtZ88OXHuDsVcdmnni93bMcQuj0MyZg5l8ANWi1vemovVM4m6W8wpIuvL0bGwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGc0CcifQPyj6dnSHwGQkyBRDLbyV/gEw05VMZFSOCqVAiA4y/SyoDrMsYTYt2pd6riFkgg9PLT8Um/Epu93oKTzDg=="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"directories":{}},"0.1.10":{"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"name":"urza","description":"Urza is a node.js framework built for rapid development.","version":"0.1.10","repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"main":"urza.js","scripts":{"test":"vows --spec"},"engines":{"node":"0.6.x | 0.8.x"},"dependencies":{"commander":"0.5.x","mkdirp":"~0.3.4","wrench":"~1.3.9","underscore":"1.3.x","express":"2.5.x","config-heroku":"0.0.x","winston":"git://github.com/jesseditson/winston.git","winston-sns":"0.0.x","mongoose":"2.5.x","handlebars":"1.0.x","gzippo":"0.1.x","async":"0.1.x","requirejs":"1.0.x","request":"2.9.x","useragent":"1.0.x","grunt":"~0.3.12","grunt-requirejs":"~0.2.9","knox":"git://github.com/jesseditson/knox.git","winston-loggly":"~0.6.0","grunt-css":"~0.2.1"},"devDependencies":{"vows":"0.6.x","docco":"0.3.x","request":"2.9.x"},"optionalDependencies":{},"bin":{"urza":"./bin/urza"},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","_id":"urza@0.1.10","dist":{"shasum":"f1e325403f6c291eccbe6bc17475750ac9ebef88","tarball":"https://registry.npmjs.org/urza/-/urza-0.1.10.tgz","integrity":"sha512-180WOQiwe8hGpnPX7NaZCNrceJ6ViUOJp+GAXip3fxo82q7PKn7hh186tV40J09JYQc4Sr7x0FBA2yc4ueomXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzhOPR7izqM+smrh39TrtLPS10GYjAwq7Yq4aaYBGr/gIgcNRdbSBl/YZrpRfcfekmcBLKb+BtGpbzPShJQR87pC8="}]},"maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}]}},"readme":"#Urza\n####Urza is a node.js framework for rapid, modular development.\n\nUrza stands on the shoulders of giants, and tries to take as much of the early-stage development out of building a site as possible.\n\nI created Urza because I had a few too many projects, and wanted a unified framework to share between them. I wanted to be able to change out the underlying components, but access them in the same way. I wanted to be able to respond to a major pivot without losing much code. I wanted my client side code to be modular, and still be able to work with SEO, and I wanted to be able to spin up a new site without duplicating pieces of 10 other projects.\n\n**Note that Urza is still in [EXPERIMENTAL] mode, and only should be used by the daring. The API will change quite a bit before it is ready for production use - that said, it is used in active development of a few projects, and so should be relatively stable.**\n\n===\n\n###Basic usage of Urza:\n\nTo get things going quickly, Urza can create you a mostly client-side site very quickly. It will take care of the difficult stuff like gzipping, minification, and cluster when you put it in production mode. (more on that later.)\n\nTo get started, install [node](http://www.nodejs.org), then install Urza via the wonderful [npm](http://npmjs.org):\n\n    npm install -g urza\n\nYou'll want this to be global, but Urza is both a local and a global dependency. The global dependency does all the scripty magic, the local one actually runs your site. Urza will list itself as a dependency for projects it creates, which is necessary. You'll want those sites to work on servers later.\n\nNext, create a site:\n\n    urza init myApp\n\nThis will create an Urza app called 'myApp' in the local directory.\n\nUrza will ask you a few things about the app you're creating, then create some basic structure for you to build with.\n\nTo run your app, do this:\n\n    $ cd myApp\n    $ node server.js\n\nBy default, Urza apps listen on port 8080. You can change this in the `config/default.json` file, or override it with a `config/runtime.json` file. If you haven't figured it out yet, Urza uses a module called [node-config](https://github.com/lorenwest/node-config) to load it's config files, so you can do anything you can do with node-config files to the Urza ones. For instance, feel free to use YAML if json isn't your speed.\n\n===\n\n###Developing with Urza:\n\nOnce you have a boilerplate site up, you'll notice that the while the basics have been taken care of, you don't have much to look at yet.\n\nTo get started creating an application, you'll want to be familiar with the basic paradigms Urza uses for the view and data layer.\n\nHere's the basics of an Urza application:\n\n####Data:\n---\nThere will be zero or more data types. These are basically Models, they have an underlying schema and database layer. The model is currently a Mongoose Schema, but will be refactored to support more data layers (specifically couchdb). I'm still deciding how much enforcement is necessary at this layer, so expect the schema spec to change.\n\nEach data type has a **schema**. This allows for typing stored data, and validation methods. Here is an example of a Schema:\n\n\tvar person = module.exports.Schema = new Schema({\n\t  name : { type : \"String\", default : \"\"},\n\t  pets : [String]\n\t});\n\nEach schema has a **provider**. The provider exposes data-access methods. All providers inherit from a main provider, which provides common methods like **all**, **create**, or **update** full documentation of providers can be found here.\n\nHere is an example of a provider.\n\n\tvar Person = function(db){\n\t\tthis.db = db;\n\t}\n\tPerson.prototype.randomPet = function(id,callback){\n\t\tthis.find({_id : id},{pets:1},function(err,person){\n\t\t\tif(err || !person.pets.length){\n\t\t\t\tcallback(err);\n\t\t\t} else {\n\t\t\t\tvar randomPet = person.pets[Math.floor(Math.random()*person.pets.length)];\n\t\t\t\tcallback(null,randomPet);\n\t\t\t}\n\t\t});\n\t}\n\n\nEvery time dynamic data is retreived from Urza, it is done via an api call.\n\nUrza's api is created by using objects, so there is a different endpoint for every action. Each endpoint can either be a deep object, or a function. If it is a function, it can be called with additional arguments by adding them between slashes. A 'default' method can be added to deep endpoints to allow it to be called without additional arguments.\n\nHere is an example to make that more clear:\n\n\tvar Person = module.exports = {\n\t\tdefault : function(session,body,callback){\n\t\t\tcallback(null,\"/api/person called.\");\n\t\t}\n\t\tget : {\n\t\t\tpets : function(session,body,callback,special){\n\t\t\t\tif(special){\n\t\t\t\t\tcallback(null,\"/api/person/get/pets/\"+special+\" called.\");\n\t\t\t\t} else {\n\t\t\t\t\tcallback(null,\"/api/person/get/pets called.\");\n\t\t\t\t}\n\t\t\t},\n\t\t\trandomPet : function(session,body,callback,id){\n\t\t\t\tif(!id){\n\t\t\t\t\tcallback(new Error(\"id not provided!\"));\n\t\t\t\t} else {\n\t\t\t\t\tthis.providers.person.randomPet(id,callback);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nThere are a few things not that the above example should make clear, but are worth going over:\n\n- each method is passed the following arguments: `session`,`body`, and `callback`. The session is the current user session if it exists. The body is the body of a `post` if present. Callback will dispatch a json response to the request - if an error is returned, it will return the message of the error with a 503 header.\n\n- objects can be arbitrarially deep, new endpoints will answer as deep as you want. You can also just tack on endpoints outside of the object literal using `Person.endpoint = function(){}` outside of the block. It's just a simple object. You can also add as many arguments as you want to any endpoint except the 'default' one.\n\n- each api method is called in context of an internal api class, so you have access to `this.providers` - this allows you to look up info from any of your providers inside of these api calls.\n\n####Views & Partials:\n---\n\n#####Creating views:\n\nAll views in Urza are parsed on the server, and rendered on the client. This allows the use of DOM manipulation in views, but also maintains the speed of rendering on the server, and has long-term SEO implications (that have yet to be implemented).\n\nEach View usually has 2 files: a template file, and a js file. A js file is mandatory, but templates can be shared betweeen views, or js files could even just manipulate the DOM - however, this will break SEO, so definitely isn't recommended.\n\nAll views are rendered via push state, so every Urza app is a single page app as far as the browser is concerned, although your apps may behave more like a multiple-page app.\n\nOut of the box, Urza supports multiple platforms. These are detected via the user agent, and allow you to create separate layouts for each platform. (Right now these platforms are just 'web' and 'mobile'. In the future this will be a configurable option.)\n\nWhen creating a view or partial, an html file will be added to each of these platform view folders. (`client/views/<platform>/<viewname>`.)\n\nTo add a new view, just run:\n\n    urza create view <viewname>\n    \nThis will generate a js file and an html file with the view name, along with adding a route for the view. You can now navigate to `http://yourapp.com/viewname\"`.\n\nTo create a more complicated route, you can create a view with name and a route:\n\n    urza create view --route \"/:someparam/:paramname/*splat\" <viewname>\n\nThis will expose the route: `http://yourapp.com/viewname/someparam/anotherparam/stuff/stuff/stuff`. These currently conform to backbone routes (but will probably use [director](https://github.com/flatiron/director) routes in the future).\n\nTo omit the html file and just set up the route, add the `--raw` flag (maybe needs to be renamed?)\n\n    urza create view --route \":option/:anotheroption --raw <viewname>\n\nThis will skip creating the blank html file.\n\n#####Partial overview:\n\nView partials are a way to load dynamic content without changing the history state. They also render on the server, using an api endpoint. You can augment the api data (if any) with an object should you choose.\n\nPartials are automatically detected by the view, so adding a partial to a view is as easy as adding an item with a `data-partial`  and a `data-url` attribute. Here is an example of a partial:\n\n    <div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\">\n      <div class=\"loading\">This content will be replaced when the partial loads.</div>\n    </div>\n    \nIf you want to inject data from the view to the partial, you can add an optional `data-obj` attribute to the partial:\n\n\t<div id=\"myPartial\" data-partial=\"mypartial\" data-url=\"some/api/endpoint\" data-obj='{\"something\":\"somevalue\"}'></div>\n\nCreating partials is as simple as just adding the file to the `partials` folder inside the `views/<platform>` folders. However, to keep the workflow familiar, you can auto generate partials using:\n\n\turza create partial <partialname>\n\nThis will create a partial in both the `web` and `mobile` platform folders.\n\n#####Data in views and partials:\n\nIn both views and partials, the object passed to the template will have a `data` key that contains the data passed. The main difference between views and partials is that a view is passed data by the router, whereas a partial is tied to an api endpoint (although you can pass it data using the `data-obj` attribute as well).\n\n####Client-Side Routing:\n\nall routing is handled by the `client.js` file, located at: `client/js/client.js`.\n\nRoutes are triggered via push state, and will (by default) call the route method when routed to.\n\nEach view will automatically answer to a route by calling it's own `show()` method. For instance, if we run `urza create view foo`, we can now navigate to `http://appurl/foo`, and the `foo.html` file will replace the content of the `#content` div. You don't have to add a route for this, but if you'd like to inject data or do other fancy stuff (conditional navigation, etc), you can add a route for your view.\n\n`client.js` contains some boilerplate code that you can remove, and replace with your own routes. Views are available on the app.views object - using the above example again, you can add a route for `foo` by setting `app.views.foo.router` to a function - for instance:\n\n\tapp.views.foo.route = function(){\n\t  this.show({key:'value'});\n\t}\n\nwhen in the function, `this` is the view, so you can call any of the view methods from there.\n\nAfter you have overridden any routes you'd like to use, you'll want to start the app to trigger the current route and listen for more routes.\n\nmake sure that the last line in `client.js` is:\n\n\tapp.start();\n\n####View Hooks & Methods:\n\nAll views expose various methods for interacting or responding to them - here's an overview:\n\n- `view.render(<function>)`:\n\t- Pass this method a function to trigger when a view has started to draw. All elements in the view template will be available on the DOM, but partials are not available yet.\n- `view.postRender(<function>)`:\n\t- The passed function is triggered after the view has completely finished rendering - you can access partials and stuff here.\n- `view.get(<keyname>) and view.set(<keyname>,<value>)`\n\t- arbitrary key/value store on the view. Good for passing data around on views. Note that the main use for this is to access the `data` key passed when data is set on a view. For instance - if you call `view.show({foo:'bar'})`, you can then access the foo key using `view.get('data').foo`\n- `view.on(<eventString>,<function>)`\n\t- this is basically a wrapper for backbone's `on` method - this will allow you to bind events to the view. Not sure if this is staying in long-term.\n- `view.transitionIn and view.transitionOut`\n\t- these methods can be overriden to add transitions to views. They must be overriden with a single argument of `callback`, which must be called in order for the view to continue rendering.\n- `view.showLoading and view.hideLoading`\n\t- these methods can be overriden to add a loading screen between pages.\n- `view.remove()`\n\t- this will entirely remove the view and it's events from the DOM.\n- `view.renderPartial(<partialname>,<callback>)`\n\t- this will re-render a partial (called by name), and optionally call back when the render is complete. It will request the same api endpoint it was set up with and re-draw the partial.\n- `view.show(<data>)`\n\t- this will begin the cycle of drawing the view. You may optionally pass in data for the view to render.\n\n","maintainers":[{"name":"jesseditson","email":"jesse.ditson@gmail.com"}],"time":{"modified":"2022-06-28T06:34:07.700Z","created":"2012-04-11T23:27:03.671Z","0.0.1":"2012-04-11T23:27:05.143Z","0.0.2":"2012-04-16T18:32:50.699Z","0.0.2-1":"2012-04-16T20:49:42.276Z","0.0.2-2":"2012-04-16T20:55:53.052Z","0.0.2-3":"2012-04-16T22:23:29.914Z","0.0.2-4":"2012-04-17T19:29:32.431Z","0.0.25":"2012-04-29T00:55:53.993Z","0.0.26":"2012-05-03T01:26:13.402Z","0.0.28":"2012-05-12T03:35:50.840Z","0.0.29":"2012-05-19T04:06:39.363Z","0.0.30":"2012-05-23T21:10:58.525Z","0.0.4":"2012-07-02T20:44:49.370Z","0.0.5":"2012-07-26T23:04:52.256Z","0.1.0a":"2012-08-07T20:02:15.765Z","0.1.3a":"2012-09-11T16:49:38.041Z","0.1.4a":"2012-09-16T20:39:59.085Z","0.1.4":"2012-09-16T23:03:09.212Z","0.1.4-1":"2012-09-18T22:29:10.508Z","0.1.4-2":"2012-09-20T21:56:57.321Z","0.1.5":"2012-09-24T22:55:09.602Z","0.1.6":"2012-09-25T21:26:19.221Z","0.1.7":"2012-09-28T01:15:31.120Z","0.1.8":"2012-10-16T23:17:54.684Z","0.1.9":"2012-10-30T19:58:44.173Z","0.1.10":"2012-11-21T21:08:45.762Z"},"author":{"name":"Jesse Ditson","email":"jesse.ditson@gmail.com"},"repository":{"type":"git","url":"git://github.com/jesseditson/Urza.git"},"users":{"fgribreau":true}}