{"_id":"rocket","_rev":"171-d4d6e4a00830f61752fd9cf06fece512","name":"rocket","description":"The rapid development framework for node.js","dist-tags":{"latest":"0.5.8"},"versions":{"0.0.0":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["rad","MVC","model view controller","comet","Notman House","Rapid Development","Rockets","NASA","National Aeronautics and Space Administration"],"version":"0.0.0","preferGlobal":true,"homepage":"wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","semver":">= 1.0.5","nopt":">= 1.0.5","abbrev":">= 1.0.3","jade":">= 0.6.3","underscore":"1.1.4","dnode":"0.6.8","browserify":"0.3.1","uglify-js":"1.0.1","coffee-script":"1.0.1","express-resource":"0.2.0"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.0","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"c78962ee8093e0b19477678b0cb78728e71f1951","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.0.tgz","integrity":"sha512-jovsCoAMGbq4/yRdpXpLJXsRC/bCUL1qGLFkN9OXUSZMA03+1FpHL5yDRbhm9dtc3GeMyFl3nmJx2eQeNEO7Uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZsltd88x/6fYBVhJHaK2OWBgBHJsP/U8rvuRwNdgCRQIgV3kK4zGVAyGGIv8Dw/L1Mtg1pn+lgUwBxW3jDvqZCDI="}]}},"0.0.1":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["rad","MVC","model view controller","comet","Notman House","Rapid Development","Rockets","NASA","National Aeronautics and Space Administration"],"version":"0.0.1","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","semver":">= 1.0.5","nopt":">= 1.0.5","abbrev":">= 1.0.3","jade":">= 0.6.3","underscore":"1.1.4","dnode":"0.6.8","browserify":"0.3.1","uglify-js":"1.0.1","coffee-script":"1.0.1","express-resource":"0.2.0"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.1","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"604d3077bff3e2654dbd569551d0a033f038d954","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.1.tgz","integrity":"sha512-oZsGJ7deAPdIMfLRcmEVx3jSxGxZv0w9Ll5ju/GyHnyypAOyaRHeGKmJ6I1XTUh4GutVYhwNIHd3RCIXEKijeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHj432xNili9kN9l2YwSJQTo7AB/16PXtDyB5UhakvTkAiB7H42S3PNtLZaf2kWkZ/r13BCLzTpdJ7lML7ZqGfR7Pw=="}]}},"0.0.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.2","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","semver":">= 1.0.5","nopt":">= 1.0.5","abbrev":">= 1.0.3","jade":">= 0.6.3","underscore":">= 1.1.4","dnode":">= 0.6.8","browserify":">= 0.3.1","uglify-js":">= 1.0.1","coffee-script":">= 1.0.1","express-resource":">= 0.2.0","watch":">= 0.3.2","lingo":">= 0.0.4","async":">= 0.1.9"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.2","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"4f1e49ffaef17be07e900a93cc02e7f3a272ac45","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.2.tgz","integrity":"sha512-ECTL7ibS2J6hPtIsWflfvFHwhgTKp+AD1jxznnfKVIWCKWccZ4a2TtMyrdDF7oMhu+mB1OOU3bfeIZt2gpsxGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv869AzfEtjtK06Qtb1cuKVeFE75OazJre8qbSj5LH4QIgUF1PdolMrOWV99GFXpvASj4rsNRz41zWiRauuh2CmXw="}]}},"0.0.3":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.3","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","nodemailer":">= 0.1.15","semver":">= 1.0.5","nopt":">= 1.0.5","jade":">= 0.6.3","underscore":">= 1.1.4","dnode":">= 0.6.8","browserify":">= 0.3.1","uglify-js":">= 1.0.1","coffee-script":">= 1.0.1","express-resource":">= 0.2.0","lingo":">= 0.0.4","async":">= 0.1.9","colors":">= 0.5.0","cradle":">= 0.5.5"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.3","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"04e80e64d658062e7b6643cf9539694ff6fdf1da","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.3.tgz","integrity":"sha512-ufHY+vZ72Wr2QNcEkaFHHhklAPxAAiazYCcp6jooonNAVUEDfcmc60yjm8xoMxLmK2yg/7IKxoSpwgrmQZf4Vg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGdQfLxb13Kt2pHoNYGvuOu65Xsh7r18toGgdRBVMeCVAiEAsVgS7iA8N1zMQEW3v9OxbGTX6mCvgv0erFlbje9MjEQ="}]}},"0.0.4":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.4","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","nodemailer":">= 0.1.15","semver":">= 1.0.5","nopt":">= 1.0.5","jade":">= 0.6.3","underscore":">= 1.1.4","dnode":">= 0.6.8","browserify":">= 0.3.1","uglify-js":">= 1.0.1","coffee-script":">= 1.0.1","express-resource":">= 0.2.0","lingo":">= 0.0.4","async":">= 0.1.9","colors":">= 0.5.0","cradle":">= 0.5.5","traverse":">= 0.4.2"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.4","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"78878da925207957a87c0ef9d3bc1e99ffdf4a2b","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.4.tgz","integrity":"sha512-c3eEEBZAC6np1i5rOqbU+BhSr/y1lsge30u9b7WvAfRtkWkvjjiMK1MUpTJZaAJ+AIqgSjWqfQFCKGWl62ky0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzuk4DwjA/1jQlZmR8pyOZVFdUdmqeI8Qbx4R4gQjqnAiEA3FaFwbmoCAjn1df03JTknCyhe4chPXVvvGBzC/z6WCY="}]}},"0.0.5":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.5","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","nodemailer":">= 0.1.15","semver":">= 1.0.5","nopt":">= 1.0.5","jade":">= 0.6.3","underscore":">= 1.1.4","dnode":">= 0.6.8","browserify":">= 0.3.1","uglify-js":">= 1.0.1","coffee-script":">= 1.0.1","express-resource":">= 0.2.0","lingo":">= 0.0.4","async":">= 0.1.9","colors":">= 0.5.0","cradle":">= 0.5.5","traverse":">= 0.4.2"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_id":"rocket@0.0.5","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.4","directories":{"bin":"./bin"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"e575c0dd5b02b64de8b35718eb6979a45cf1ea90","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.5.tgz","integrity":"sha512-2sKHV2KE6QXhbdUzccefPgR5e/ajHFSiQ2lvirsMDZ3U0DqflQhgPjqmD+LJ2ZeUu9YalsdSFrvzI9c8awWbeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBT4/F4cNK6lykQ+//CWh4bJFg6HpXaAunwo6c/IHStKAiBp/KhRdUZY9QrDU3Ht9FmTlgQFJZTGku1KQz4kAvEJgA=="}]}},"0.0.6":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.6","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","nopt":">= 1.0.5","jade":">= 0.6.3","dnode":"= 0.7.3","browserify":"= 1.0.0","coffee-script":">= 1.0.1","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.4","colors":">= 0.5.0","express-resource":">= 0.2.0","cradle":">= 0.5.5","traverse":">= 0.4.3"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.0.6/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.0.6","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.4","_defaultsLoaded":true,"dist":{"shasum":"7ef43d85cca1f410ee4c56d09e4cf58bd43eb450","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.6.tgz","integrity":"sha512-DJoegNp3AXoBSGcOAZfFiC1VJnc1z1VutqlOTGXIKUGJ8bAB/pv053dVIJxSbkw9cHCDw/HnwXYEP0b6yGMUNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf5yk0CTbe5bfnTbriJW+i7zjsnliDrTdeCQ1h8dTVOAIhAPJcYS6KkujkMD55tQrhBqeFVYboiog+O04PU5pCCxjZ"}]},"scripts":{},"directories":{}},"0.0.7":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.7","preferGlobal":true,"homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 1.0.7","nopt":">= 1.0.5","jade":">= 0.6.3","dnode":"= 0.7.3","browserify":"= 1.0.0","coffee-script":">= 1.0.1","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.4","colors":">= 0.5.0","express-resource":">= 0.2.0","cradle":">= 0.5.5"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.0.7/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.0.7","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.4","_defaultsLoaded":true,"dist":{"shasum":"0aeb04eb878b613b14296ba3f68e25ab8521315a","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.7.tgz","integrity":"sha512-bgAcwxATpN9BQKB/ec5eB27FppKpPDiUq2bTmUisGA3IWHIPDnB+C2jCwn23HunmHOKmv9Fm9xHVWTNCF9KYpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSTWKleYmKmhCLf9c5vc0bK3SQPfwr6Z3DooATgagjCQIhANnIqD5YYZ8qMR8QnNS7ryWfaVarsJOWngHa2lAFFDt/"}]},"scripts":{},"directories":{}},"0.0.8":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.8","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","dnode":">= 0.7.3","browserify":">= 1.2.4","coffee-script":">= 1.1.1","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.6","colors":">= 0.5.0","cradle":">= 0.5.5"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.0.8/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.0.8","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.4","_defaultsLoaded":true,"dist":{"shasum":"a529a195f7ab1d1a7c8ad5392e3e91d8a4721be4","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.8.tgz","integrity":"sha512-+jEhB22b5aavcU3BRN1Jm9l9V6rfnaGvA4tlpMpJ3GQGucHWTtTLiZaSPMoDaORD1lYBDd0du9vEs1O3VWeNyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcQMZs5BixWZskcjg/cO9T+XXfrmuwZ5O+qaD+ZScsEwIhAMN3vbJ823YLXMiqNxGtd0vxhwIdPNPADOl2hYKi9Wz2"}]},"scripts":{},"directories":{}},"0.0.9":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.9","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","dnode":">= 0.7.3","browserify":">= 1.2.4","coffee-script":">= 1.1.1","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.6","colors":">= 0.5.0","cradle":">= 0.5.5"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.0.9/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.0.9","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.4","_defaultsLoaded":true,"dist":{"shasum":"e0255fdbac81c953c624a0d802288ed3637ac0dd","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.9.tgz","integrity":"sha512-gKiuo9md3oEZHmhmDhUGsp2pNCgle9MlFnLl11kuZ/P3U18zCBttXTS9qXwZ4zIN1S3BX3KBiA6vx1ZEWPVc6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkPNjShJxVutRFFm3fPcp/hPzhSz2F5jIGrubJx39PqgIhANXzPUrV7itSsG7Fm1WpOTtN5rVnHTGkfk9Mn8VerprC"}]},"scripts":{},"directories":{}},"0.0.10":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.0.10","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket_main","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.4"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","dnode":">= 0.7.3","browserify":">= 1.2.4","coffee-script":">= 1.1.1","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.6","colors":">= 0.5.0","cradle":">= 0.5.5"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.0.10/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.0.10","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"70dbc2c1a45ecb62bea1da25b9807a46330f9eba","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.0.10.tgz","integrity":"sha512-cZmfzLmK8awB80UxvPuDtLi+ag2pTOQUfChY6qte7QaArlOcHp1+tOr0oyRS/cKNa00j1vDlSt8OE8LlztYqYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2/mJRRjNyfBuR6ilFOhV77qflHlw5LT/kqLWTvVdDagIhANILYATFRwrXD9YLajs1xATNB5af1aMFahNy+4AlorNi"}]},"scripts":{},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.2","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","dnode":">= 0.7.3","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":">= 0.0.2"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.2","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"9fdb97bdb50d81494edf5081148f2b1ba1a0df9e","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.2.tgz","integrity":"sha512-6E3Wi2jnCGNTMKxam0KMRZLShwjwQ24P/mI7akIE2sErhzacgfxyoP3uVqKoVGb1uSlFFxGXnwGNBJgv/i9K7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDiWAcnSj5jmGTxIEvm7eBbKyzu1JRRgbMewBGcP5PIAiB2J4A7d1tbp1NfJbMHhu5mmy1wDNEghib7aLNhLYQW5Q=="}]},"scripts":{},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.5":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.5","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":">= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.5","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"bc1498fb8c2226c33f32b0813f3d998bb3b8cee7","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.5.tgz","integrity":"sha512-qidEbYJ5LLcHr7eDaueIRv3dlzxGfkUvYikg4dih1ClNEJUgHQ5Qr43GCIQ/lyYmQDwVQq9uagNcijKprk3GMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCR4CeExHP2WI8v4jsgJyMYPLxnDAxyyno0jzAtP0q91wIgd4i/6flR+eL7rD3R6Xh/i9pwLyWI10Bkc616YG2+FWc="}]},"scripts":{},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.6":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.6","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.6/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.6","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"889009113a2e7677a649cd2af3bba7cde6f1721f","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.6.tgz","integrity":"sha512-5yvRebmWtCnU5MFoJXmwPwAq8SnHza3vp9nmSSBbbUFNAs4ouDQ1+4KzCQ3Xdz1wDCPxmKLos15CRs6up8uhaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmVLDkk/5q1q9cEQzWOn4kH6X8IjAA5sM3dEspXNaq8gIhAIV3Stg8L/WyU64BZ+7AWniyPLyKznD5DEvqlZ+zqPPJ"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.7":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.7","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.7/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.7","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"90acbe67d167e6ab533e22b3b4a69808e59aae60","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.7.tgz","integrity":"sha512-kEvDvRcIqRHjkZb0f/TnZUdl+z4SaFx3GaO7Um/JJ4Qc87pv7Or+eCae6VbPCnf3qc/jdJUPKadTs5IMUfwMLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkrc/BXtXU3BasCmCmEifvjbIgfXnCChAWRH2TmLWpwAiAB3qy0WCJJR23Lh1pzjx2yo3vU8OCujuiB+PbKXJC1Lg=="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.8":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.8","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.8/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.8","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"9b72693a74fb8c2d5bbc14960f8c3f43c66dfc6f","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.8.tgz","integrity":"sha512-f0hMRTKo+EAj299bAyVF5DPZ8ISAKqjgR3Rf6cOJrEYxsLy7SztiYGYYp7Dx4w0/8UqoNWvpgzPOEl+RxaKTnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPUZltE5ZCM06Y1SvDD5scteEii9cKBHi0rl886HJfMAiAnI+kQp3VGCOb0Mz1tyR1vyTqfGqU+XJF1Byo9wkVwAQ=="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.9":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.9","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.9/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.9","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"89d699a72da79321a1754ce034395267a4e912cd","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.9.tgz","integrity":"sha512-QCaWdqA/YunK85ecEooxUdCQIGZP0DDwEc2XnVxuEvaW2ElcVByLAN/74yO5XrQLPMKj4lC2jsQkdE0RExpqpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiWBwjYsEQB46BUA7uKsP5kpv2WU1SDM0QgrQLv2eXMQIhAMPGv25xzdE0/mlavtXwI6qXU6gkvQroPlLIDinAJaGA"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.10":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.10","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/Users/glesperance/.npm/rocket/0.1.10/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"rocket@0.1.10","_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"73766e3122f658abaab9e4fb92ca6d6eb395d09b","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.10.tgz","integrity":"sha512-bHvXLBtjA9tia7V0LUIW0nBrGUwVOHQMg7y2Fo9sjDl9ZMrparVUiWvwCpDJzUzwLTAqEtss9q+thftQXUZfNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoRWRpUhSQWxuQTw9lN4Bx+SKRi6zflsJ1hk8gf9QfmAIhALUsNcYE5cLN3z672q3S7Nb0ZItehL7Fbfsbc4cSbDgl"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.11":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.11","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.11","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"bea079298ed641c1d9d85b4da18430625bad1874","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.11.tgz","integrity":"sha512-BbGH0jSYk1Sb18OCAYYOuQ1aC5nwfOiokDWqskm2WyyHudJU2AO8ErqRn6g1lctg36KYM4GmoejChtgkD9wdLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHc9Zro5NeNZaXbFkqT2IzjSCaw3FsW8RZTcCbQJJXzgAiBq0tJh9aBC1tnuHrKNjoM21j/caGyQ86T8e7OzhiIeLw=="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.12":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.12","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.12","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5ea99d26db589975193b2203bf38c25ffd0d3926","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.12.tgz","integrity":"sha512-j3Ns73LbWiTPzSuK5SPxObCma8uFjo4OasB277ixDdxfu4zZW9MTwYe2goWpMu/VnNWXW/MmyVgsc8zxutMA8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSU1zMIW5Q9lQH8YAjt9SdzYfp9XczQNaWaTlY7XTWkgIhAKoLushQJdGq5soJ3uEuXR5MDmrG9KoUsXpug5ea2Sar"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.13":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.13","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.13","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"fa5173def6c4e1d926bf7f27ebe48ee5dcde6275","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.13.tgz","integrity":"sha512-EEQT9PDVylOkJp++S2Q/KPEugzDkvEQaOjoN5ZvAyB63Sf6V/ku3W2oFZngkki7YDE3XVzTfT5ZgrKDT1w1GOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDeD6/TTQl7dITmHNDxC61fgJ42mvNrbghLVH4zSSOCRAiB7kxbuKPWgFX/hwaCxtB1CRIzznC5iXg7zWHIikBxg3A=="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.14":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.14","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.14","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a2d3af4759ffb708113528a5a84b956845e01131","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.14.tgz","integrity":"sha512-1cpA/cm3Q8tgEkU0c3hW7E/y3C9Ki3BJwAaK92p1IbRt2E6PvuZnbGtp0vM8q/sjJvq/n98KTNPz0m395tiDIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkJKsPFgfiaJ09BcDukuhdW6gZ/NFQFfEIWbtlxreAfQIgUiwD8k0JkF1VvOGsuT4GFA2FHb/8bN2M/mIEOn3s+ko="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.15":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.15","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.15","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"bc7f9f1520812459679524a3af9b7085e81488f2","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.15.tgz","integrity":"sha512-X0pEaLxgw73mt5jdxTcH8xaLPA9Nultg4VBgSy4vKIqsVEvjrU0L6qdrQSLCtM6gtn1PQUZr47Q8SKm+iCijaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2YjMHlvyJnwi+PtKtWI2/uzJki1rXv2jE4JafHwPAaAiEA7Ey8XfjD407vnCFd0QPg13UZ3p3ty7XNw4ZPZiraReU="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.16":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.16","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.16","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"55281adfe137128ca1646995e10441174604ca07","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.16.tgz","integrity":"sha512-jQsOLXBJ7FF2wQJEAkT8GLcqtMHogNofI6HNrpvGx5QcfId14ggi8CAo4+TP2NGLjhNwCK+qHd6hX31I6u4NEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqqwQyZYe5u3NKc/D0dqvxAtPFdpR2FTqFvpnu2NkmuAIhAOf++qnAvPI3KhMxZ614BRyragxBb8+GP0Bl2fBuubS/"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.17":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.17","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.17","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"4c2a269d545ba16b8fdb87e3f74caa43c3231a0f","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.17.tgz","integrity":"sha512-oM3LiSf6HB0hMYGSPvFScx/HGE6nNhQZh7+yL4SpOMF2+jN3GxAA2W++se5ENSSgmxV4SfDJtYK4+cOD2Eayqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMYz2vxMkMRPYRtjQxSbLJ+jVHuigpSPHBpVxics3BawIgdXtiE3Ky+9vTWmIJ62l/UgkXIt35i6UqeTHVtHG50zQ="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.1.18":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.1.18","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4","colors":"0.6.x"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.1.18","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a839ae25d9ae87dda82b4e8f7e888509290fd8df","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.1.18.tgz","integrity":"sha512-zNP/MyFF1FvlwPEOoc2r2fz9OSboOsNR0gt/DaJ7xIFTKpoIOX6CM3YaOYZ1LE4sa91FNSZslt0XbrYlllycJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtwlulCcv1bBFrfIbq8zlE4nFMhdd2jAr08qWDgVJg1wIhAMTDqL5LUulCjUk2I4dApEgBq/ZzOdTXz1lr0ScwLIIc"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.2.1":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.2.1","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4","colors":"0.6.x","gzippo":"0.1.4"},"devDependencies":{"jessie":">= 0.3.7"},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.2.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"7ee5d8b73a4542008f10ee2b009840876d22dd5e","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.2.1.tgz","integrity":"sha512-d0QVdgthOlU9ySd5pjy/FEc4YHHGg9e+KfBgC8wwzmtiAX8nydqwvFF0EzCG+iSxnweyBsW72vgqrpKG7wEB3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLVuAAJezmqD1x80LzJ6/K/dgLlXVKx/NF3OoVAli/uAiEA8IyJ0jJ6zYEqg+qP6J7pON8BnCX29KraMc5P0xqtHlI="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.2.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.2.2","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.3","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4","colors":"0.6.x","gzippo":"0.1.4"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.2.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"152d1f2a20f01eaa803a99564b69345dbf8a916f","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.2.2.tgz","integrity":"sha512-k2p+Su6+ArRbSztEpimt2BZmhCmQte5iP15CQYAPBXeBUNTTetvzdIeNUNJ0J/YeMg7h/vu+U7xfN3YOf1uqfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMf0r0mZDDDsn0tZIQ+hCN8U/LXuu4vq97yQSgX+UOfwIgYIxJW8ouFL8YJWmdGpRtiHCUko65jKOwB0cRGHzvJxA="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.2.3":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.2.3","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":">= 2.3.12","express-resource":">= 0.2.1","nopt":">= 1.0.5","jade":">= 0.12.4","lingo":">= 0.0.4","async":">= 0.1.9","async-fs":">= 0.0.2","underscore":">= 1.1.6","rimraf":">= 1.0.4","oo":">= 0.0.3","jade-i18n":"= 0.0.2","now":">= 0.7.4","colors":"0.6.x","gzippo":"0.1.4"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.2.3","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"9c0ddcb06df411448b55a534679d79879a37dcb5","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.2.3.tgz","integrity":"sha512-nehd7vkIo6fMfeMhxtBe4Qq0GAOigfKZ2/R4auAeL+4UceZf1LsICKIE72VgMcKzA8/4zPPNcIQ/b+vKAcqdOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlgmejAlU2ovhaL0fO3kl8EKAUcfMzzv5y8FMvFew8mAiA7HUowS7rHIAZSw2r0tvlfhVQO0Xu4f/V3pviGAETv1w=="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.2.4":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.2.4","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.2.4","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"ddb6fc2dd588f62856d127ce0d0a5eae7043c2ef","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.2.4.tgz","integrity":"sha512-qj0gRCCQMPkeEvkuD/eVmjzzyt+lvaMGWsEq35hctcTyt3nk0tAVp2T0BCvGh+dwqrmWlb4WU7uJI4FoMd8Y2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBlP3YbuCuKJaEW3dj12vHEREjo+ZTphFXM9kvdOZHIQIgIxvGGhC24WFPXyYtYtLe17ZBfeAi32LGYS55Imxa1zQ="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.3.0":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.3.0","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.3.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"84f72e8ab965fa3fb0b956c279d19d2ccaf8b243","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.3.0.tgz","integrity":"sha512-JPtmtckZfpyiFTMgZ/dsiIriBjR0BywSM9jULO1oswGBheE2NCJoP0IuoYdih8HnTe2Bwa7hdVplCd9wdPneVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCf5CIhBB/4LZST/mR26hCF5vGX8Wo6qtrKOelcjlctAiBeciwHIKHS9VHBAze1NEv/NiGHB9n7VCTGuWI6XVxkTQ=="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.3.1":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.3.1","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.3.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"9a57b7b7da21d25265b84c1a68927ccae8e23a09","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.3.1.tgz","integrity":"sha512-7G73d9ugMI63aMLFhlX8t0tnAIk2HWv584xw1H0a1eWWmpqWdKC3P+0KSpHMEuqDTWLHld3WUuT+Fi95Yr43Ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRK4e5jr3GF3OkfGvhsh99ucjGRfRC2OPp1fLTzeUUNQIhAJh0p2lwBnw34BHxfO4vXUiRy++rz9Y4iMU77s7DRFSe"}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.3.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.3.2","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.3.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"2b5be32b3204826bfc32e65fc231dfe1f76466e7","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.3.2.tgz","integrity":"sha512-ZXKNFq6rIZxyXY/WFWeyLRNcDLzUJbe0zzSwd8/HgCIXHDZHUTiCgtvlwfVUk7jT7ZLZ1BQhjpzvkBzN9yL9RQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+Pe0Of6t6dnvFEV/FTsUiQiBIqdwaaBpGZZ6zROu4fwIgH3MMktIXiBk1NDmB8CnhegHlm/q1JB4KSabH7tQwOAA="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.3.3":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.3.3","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.3.3","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"22062203a983899362ad4925a4f33253462c034c","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.3.3.tgz","integrity":"sha512-Bq0kD8w1OpnBjXqj3pZIxmtXJlgqMhL8M3t3KOSgno9arqnMIt2vEQXoF8MKVAF1KDtu969iFmFTdPq8Tz9TsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH1DE8itKyuGDB0ypmjed9hDrFUAwiMwKfqGKIcK2NvQIgMOVryvUqYNtuqo+3LpoZ6sr86i4MYXx6k2EVfLX3ngc="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.4.0":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.4.0","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.4.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"878c10daece12e672417c72a58db5133c48417ef","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.4.0.tgz","integrity":"sha512-NfplLa2wGYgjSQBMFJy2JHMK/KFJDE2lsYfYuqT8wJVTHF2+aNRzWWXaTraqBNLwiHjFCkMc8Pb0suoNe8cZlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0NvG9ribYTkY9nIXp5QBRsN6JjsdG+mrjOBDC0yYgFAIgR4q7k5HuKf7ksgLUhPOrPZRx4k5d740HqU2ZV5UxsSA="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.4.1":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.4.1","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.4.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"d6c56bfd92fe61050f05b7f4e0c232fdb2a9631d","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.4.1.tgz","integrity":"sha512-T/A5EV/oP6WtiOQif5i+boipviaF9h+taa6UZGtg2U6bmhcFHEaDUgFBcqdyq1O4Xulmx2UWJA/Uzpn9fs21xg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC43RkqCjSF07AWUVzblWmuz3vPJCv/3P4bD+s4WF4xBAIhAL9DLXhhRnj9pwT9wngqfDVKmpFzz6mJk3VoGBa4cMUb"}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.4.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.4.2","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.4.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"ad2891a4b6fbb36a3c3b14ced06e50c4e8c5f2b8","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.4.2.tgz","integrity":"sha512-OKhKFjU/wwHwwwcdCW78XPq9D2Dfh3DLIM9pzh4IbMy1+3w+ORn8Q78QXPZwq1V8pBGDOf5+O3Ns28V+7aCPew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFOYKqcFjaPemh/ssiboE1MBqv/5tTQxMMYAnKSzoM7/AiANj70ysmgkAreqSC7TLQw6rO5Um9NSrKBoBIXfRQng3g=="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"directories":{}},"0.5.0":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.0","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.5.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"b4cd2bb84fb7ab5739eddee62c1401ba089f65e4","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.0.tgz","integrity":"sha512-SBgIk3kTsl/dpG83Nu1C1433BPjA3CMnqwJIPJ77/IyJUfoMBAnVOBlt+cEogZs+Zbe8l+CexutHXyvSVbdUHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEY8lkYQBWoM0hxh64Vc6IZoB3HE0xJNvqmB2EnBq+qQAiA64ZMlyzuxqu2hZs41TVVPdFBASQ5axN5UvZBWEndDkQ=="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.1":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.1","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"1.0.x","jade":"0.24.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","gzippo":"0.1.x","requirejs":"1.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"_npmUser":{"name":"glesperance","email":"gabriel@wavo.me"},"_id":"rocket@0.5.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"f864c151872dd4d655ebc0c60b683011154e687a","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.1.tgz","integrity":"sha512-SJZ62SU3cpxIQtyYTrRPSHIgd8Y8mVFgWVJLrEaxkciSfudF2TvrF2z9dqeX7+1VOjlHBky2I48TYOFNKv1qxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDd7IsdJV9mgksczsWeynmPo2VLa7plNLmhyCt+PcFCTAiBz2gFFLKpzE+UC4SqN21ikm4ZZ27g27ST3/4PsxxiRwg=="}]},"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.2":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.2","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.2","dist":{"shasum":"e3afe072249e02cf3c84ba362027e47589d9ffad","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.2.tgz","integrity":"sha512-qAFBuBoxz47hvQDOn44GGtc2RIcGfuFZwp/KxmF1Ta2qHshzuXBNQAGccVG2QSgr1L4NlwrCHMtqAhVXIG0mgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKdDkYTJGvYqWxyKWkQUQOfAPFepxPIdHo9yJJd580awIhAI12biQG5Bgwwb5AWdUMQa7i9VIvkJzuD258S9QPPaP9"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.3":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.3","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.3","dist":{"shasum":"e5b97f13e9ef95db2f024a4487cf0133ce320258","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.3.tgz","integrity":"sha512-8QffOkXZvHKgsISlJ5ZJJbf7CeSHr8bnXg3brTRtseP+gJtnzl1Mcy/X9iIFxF/Y4MIh1nviSuP70729d9P9RQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8TTpnXMjn3hjLk9R4ZbTeI9Ck5GHxWpAWKHuQvW3IZAiEAj9TQWkc9eDIzkk5DMpq8qGH2looiREdxbGndOwN+9JA="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.4":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.4","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.4","dist":{"shasum":"f39ee15ef83a46d14f2e23b8f0ba2b34c54f7eca","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.4.tgz","integrity":"sha512-2DirIMhUIQMnbzxvGIpRUb5EgraxE1SU+Cv5r4cMLXk6YqBnNluJr/CGLQg7/NrCLP4gSU9Mm8Mq8Lelg+dRuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmQNM6lF1nc6GXvfA+I5+Y6fomxwg4eNlByuBp2I/WswIhAMQrGSBbtos9V3NFwGCfDOsbAOQ/Hv/2YMzjQoPFNJ2b"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.5":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.5","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.5","dist":{"shasum":"830fd3c069c73d2b89b3eaf63d2356e5421adfb3","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.5.tgz","integrity":"sha512-Lp1xddYwZtFtNe5H1TI/0BJXhgsgNrXwlwoov40VCjM3lW25iyu/wTMzodzQYApEnUmiGHblK9v0LB74RNbqYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJLSnBrstG/xi/3H5DZ85VSMOR1odUe/R9IVcL9tSZLAiEAwajuFcxRfPR2su6yab2IcpvB/BS+/m+5qyNQSCo8aQI="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.6":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.6","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.6","dist":{"shasum":"099361c458f79060a695534635c2b4c40c50afa1","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.6.tgz","integrity":"sha512-yDSKkON4ZRkVVLK4v+f4rMRoZvHccbZ51Igs6jaIJLIb2rkFoikCUpSL3WkUs0eR/jt0O2BTnzoYtY9VkVJbAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZGzxzzbmLjbEbZxutjsYadD5wzpHw/eHN+XAcfM27BAiEA/cpPSBWi2Z5IMJFUKmhIpfGB5wkI5ad6eTA/fl1TjlI="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.7":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.7","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.0.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.7","dist":{"shasum":"2ab5fda701588081a70f9c65ea9fb52b7b0e01fc","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.7.tgz","integrity":"sha512-EF4gPnXNGaZTgMtSqKtmIduhPcYl44wWwNVpcv3nxj36jhhtAuNXIsF/1AkCGjx858Qmhi5faWCUppPAdLO1zw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWII4Sz5t+BF8u82P5sTc8/wov5XWcVudNDevl/kxcyQIgB1ZJAUHBSzr2n4jqmAIpJOmkTepnnAXCVZ6NNFo84KU="}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]},"0.5.8":{"name":"rocket","description":"The rapid development framework for node.js","keywords":["mvc","model view controller","comet","rapid development","Rocket","framework"],"version":"0.5.8","homepage":"http://wavo.me","repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"main":"rocket","bin":{"rocket":"./bin/rocket.js"},"engines":{"node":">= 0.4.10"},"dependencies":{"express":"2.5.x","express-resource":"0.2.x","nopt":"2.0.x","jade":"0.26.x","lingo":"0.0.x","async":"0.1.x","async-fs":"0.0.x","underscore":"1.3.x","rimraf":"2.0.x","oo":"0.0.x","jade-i18n":"= 0.0.2","now":"0.8.x","colors":"0.6.x","requirejs":"2.1.x","wrench":"1.3.x"},"devDependencies":{},"licenses":[{"type":"MIT","url":"https://github.com/glesperance/node-rocket/raw/master/LICENSE"}],"readme":"# Rocket (node-rocket)\n##The rapid development framework for node.js web applications\n\n<img src=\"https://github.com/glesperance/node-rocket/raw/master/lib/logo.png\" width=\"200\" alt=\"Node Rocket Rocks!\" />\n\nRocketJS.net a.k.a. node-Rocket is a project created by Gabriel Lespérance during the “Startupfier Summer Kick-off: Hackathon” in order to allow rapid development of real-time web applications using node.js.\n\nHighly inspired by Ruby on Rails and cakePHP, Rocket puts forward the convention over configuration principle in order to simplify and speedup the software development process and allow easier scalability by leveraging node.js asynchronous behavior as well as its javascript nature. \n\nCentral to RocketJS is the principle of having a single point of contact between the programmer and the underlying application and resources. Hence, RocketJS aims to blur and reduce as much as possible the separation between the client (browser) and the server (node.js) while maximizing the scaling potential (for instance by allowing code sharing between the server and the client) and improving the performance of the resulting web application.  \n\nBuilt on top of express -- node.js’ high performance web development framework -- RocketJS provides a robust structure on which to build your web applications without sacrificing any of your freedom.\n\n### RocketJS Features\n* Automatic routing of your controllers\n* Automatic mapping of your views to their corresponding controller\n* Easy web-socket / comet application support through dnode\n* Easy server / client code sharing allowing the client to  use RequireJS  `require()` command to import/use server JS libraries\n* High focus on RESTful controller conventions\n* Client-side support for jade template\n* Automagic optimization of client javascript modules and CSS files\n* Easy i18n localization\n* Automatic reloading of modules when a modification is detected allowing easy and fast development.  \n* View rendering and partials support\n* Connect middleware support\n* Built on top of express\n\n## Installation\n\n    $ npm install rocket\n    \n## Initializing Your Project\n\n    rocket -I MyRocketProject; cd MyRocketProject; npm update\n\n## Launching Your Project\n\nWhile in your project's directory simply do :\n\n\tnode launcher.js\n\t\n## Directory Structure of a Rocket Project\n\n    ./\n    |\n    |-- client\n    |    # Contains all the files used by the client, including CSS, Javascript libraries and \n    |    # static files.\n    |\n    |-- controllers\n    |    # Contains your application's controllers.\n    |     \n    |-- exports\n    |    # Contains your application's modules that will be exported to the client. \n    |\n    |-- libs\n    |    # Contains all your (other) application's libraries.\n    |\n    |-- locales\n    |    # Contains all your localization files.\n    |\n    |-- models\n    |    # Contains all your applications's models.\n    |\n    |-- views\n    |    # Contains your applications's main layout, template files and associated\n    |    # partials.\n    |\n    |- launcher.js\n\n## Client\n### Structure of the Client directory\n\n    ./client/\n    |\n    |-- css\n    |    # Contains all the CSS files that are exported to the client.\n    |\n    |-- js\n    |    # Contains all the javascript files that are exported (through requireJS)\n    |    # to the client. All these files can then be accessed via `require()`\n    |    \n    |-- static\n         # Contains all your static files.\n\n### Allow the browser to require() your javascript modules with ./client/js/\n\n#### Structure of the `client/js` directory\n\n    ./client/js/\n    |\n    |-- libs\n    |    # Contains all your client side libraries used by your client modules. \n    |\n    |-- vendors\n    |    # Contains all 3rd party libraries used by your application.\n    |\n    |-- templates\n    |    # Contains all your client jade partial files\n    |\n    |- require.config.json\n         # This file contains all your custom requireJS modules paths\n         # configuration. This is extremely handy to make sure you always use\n         # the latest CDN version of a public module.\n    \n\nEach files/folders located under the `./client/libs/` directory of your project \nare made available to the client's browser by **Rocket** via the `require()` command.\nThe modules are referenced by their relative path from the `./client/js/` \nfolder.\n\ne.g. To require a module located at ./clients/js/a.js from the browser:\n\n    require(['./a'], function(a) { /* ... */ });\n    \nThe modules can also be located further down the `./client/js` directory tree.\nHence you can require the file located at `./client/js/nested/dirs/b.js` by \ndoing :\n    \n    //NB do **NOT** put the `.js` after the filename !!\n    require(['./client/libs/nested/dirs/b'], function(b) { /* ... */ });\n\nUsual _RequireJS_ conventions apply to the modules.  \n\n#### Using jade templates in the browser\n\nIn view of reducing the friction between the programmer and its environment\nto a minimum, rocket allows the use of jade templates on the client side.\n\nTo do so, simply put all you jade partials files in the `client/js/templates`\ndirectory and let rocket compile, and bundle those for you to use in the browser.\n\nTo use your template, simply require it and use it !\n\ne.g. To use the template located at `client/js/templates/dialog.jade` you do :\n \n    require(['jade-runtime', 'templates/dialog.jade'], function(__, dialog) {\n    \n      var html  = dialog({ title: 'Hello World !', message: 'This works!!' })\n        ;\n        \n      /* now use your compiled template ! */\n     \n    );\n\n#### Requiring javascript files from a CDN via require.config.json\n\nIn order to speedup page loads and to further comply to DRYness principles, \nrocket allows you to use CDN modules as if they were local, making sure you can\nstill benefit from all the requireJS optimizations.\n\nTo do so you simply need to list those modules in your require.config.json file\nlocated at the root of your `client/js` directory.\n\nE.g. to use the google's CDN jquery, jquery-ui and cdnJS's version of underscore,\nyou'd need the following definitions in your require.config.json file :\n\n    {\n        \"paths\" : {\n            \"jquery\"      : \"//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min\"\n          , \"jqueryui\"    : \"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min\"\n          , \"underscore\"  : \"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min\"\n        }\n    }\n\nNote that we omitted '.js' extension for the modules...\n\n#### Production mode & Optimizations\n\nTo further optimize browser load times, you can start rocket in production mode\nby defining the following environment variable at start:\n\n     NODE_ENV='production'\n     \nWhen in production mode, rocket (1) bundles all your javascript client files at \nthe root of your `client/js` directory with their dependencies, and then uglifies\nthem.\n\nThus, when those are used on the browser, only one request is needed to fetch them.\n\nRocket also (2) bundles your CSS files by resolving their @import statement.\nThe resulting CSS files are also minified.\n\nNote that since your client jade template are compiled before being sent to the\nbrowser, they are optimized too !\n\nAll those optimizations are provided by RequireJS r.js utility.\n\n### Serving static files via ./client/static\n\nAll files located under the `./client/static/` directory are statically served\nby **Rocket** under the `http://example.com/static/` URL.\n\nPutting forth the use of conventions common to all **Rocket** projects, every \nproject is initially created with the following files/dirs in `./client/static/`:\n\n    ./client/static/\n    |\n    |-- font\n    |\n    |-- img\n    |\n    |-- apple-touch-icon.png\n    |\n    |-- favicon.ico\n\n\n## Controllers\n\nBy using a modified version of the powerful [express-resource](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\") plugin, **Rocket** provides\nyou with a robust way of automatically mapping your _controllers_ to your _routes_.\n\nEach time you launch your application, **Rocket** takes all the `./controllers/[controller_name]_controller.js`\nmodules, and maps their exported functions as follows :\n\n    GET     /[controller_name]              ->  index\n    GET     /[controller_name]/new          ->  new\n    POST    /[controller_name]              ->  create\n    GET     /[controller_name]/:forum       ->  show\n    GET     /[controller_name]/:forum/edit  ->  edit\n    PUT     /[controller_name]/:forum       ->  update\n    DELETE  /[controller_name]/:forum       ->  destroy\n\ne.g.: \n\n    GET     /forums              ->  require('./controllers/forums_controller').index\n    GET     /forums/new          ->  require('./controllers/forums_controller').new\n    POST    /forums              ->  require('./controllers/forums_controller').create\n    GET     /forums/:forum       ->  require('./controllers/forums_controller').show\n    GET     /forums/:forum/edit  ->  require('./controllers/forums_controller').edit\n    PUT     /forums/:forum       ->  require('./controllers/forums_controller').update\n    DELETE  /forums/:forum       ->  require('./controllers/forums_controller').destroy\n    \nWhere **{index, new, create, show, edit, update, destroy}** are normal _express_\ncallbacks functions :\n\n    function(req,res) { /* ... */ }\n    \nIt is important to note that\n\n    ./controllers/root_controller.js\n\nis used as the `/` controller.\n\nFor more info see the [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n### Conventions on controller names\n\nController names must :\n\n* be plural\n* be all lower case\n* be underscored\n* have a *_controller* suffix\n\nHence, \n\n* `./controller/hyper_beams_controller.js`\n    \nis valid whereas\n\n* `./controller/hyper_beams.js` \n* and  `./controller/hyper_beam_controller.js`\n\nare not.\n\n### Defining custom actions for your controllers\n\nIn cases where you might need to derive from the RESTful conventions, **Rocket**\nprovides to  you a way to add custom actions to your controllers by mapping any\nexported function but {index, new, create, show, edit, update, destroy} as follows:\n\n    {GET, POST, PUT, DELETE}  /[controller_name]/myAction  --------------->  myAction\n\nYou can also be more specific in your mapping by making `myAction` an object:\n    \n    GET     /[controller_name]/myAction/ --------------------------------->  myAction.get\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.get\n    \n    POST    /[controller_name]/myAction/ --------------------------------->  myAction.post\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.post\n    \n    PUT     /[controller_name]/myAction/ --------------------------------->  myAction.put\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.put\n            \n    DELETE  /[controller_name]/myAction/ --------------------------------->  myAction.destroy\n            /[controller_name]/myAction/:[singular_controller_name] ------>  myAction.destroy\n\n### Exporting functions of a controller without mapping them to a route\n\nBy default *Rocket* ignores all exported functions prefixed with an underscore `_`.\n\nThis can be used for example if you want to be able to `require()` and extend a\n*base* controller from which you want to inherit some property or methods.\n\n### Auto-loading resource for your controller\n\nIt is possible -- via express-resource -- to *auto-load* the data associated with\na specific `id` for your controller to use.\n\nSimply put, this can be done by exporting the function in question as`_load` in \nthe controller module.\n\nAuto-loading functions take the following form:\n\n    exports._load = function(id, cb) {\n      var err\n        , obj\n        ;\n        \n      //(1) -- load the object with the specified id\n      \n      //(2) -- call the callback\n      cb(err, obj);\n    }\n\nFor more info see [express-resource readme](https://github.com/visionmedia/express-resource \"Express Resource - GitHub\").\n\n## Now.js exports\n\nBy using [nowjs](http://nowjs.com/), rocket \nallows you to export server objects and make them accessible to the client.\n\nTo export a module, simply create a javascript file in your `exports` directory\nand rocket will automagically, export it for you.\n\ne.g.\n\nThe `exports/chat.js` file :\n\n    exports.sendMsg = function(msg) { /*...*/ } \n    \nwill be accessible through nowjs in the client by doing :\n\n    require(['now'], function(dnode) {\n      now.ready(function() {\n\t    now.chat.sendMsg('Hello world!');\n\t  });\n    });\n\n## Models\n\nStarting with version 0.1.x, rocket is database agnostic. If you're looking \nforward to using a noSQL DB, we recommend you to use [mongoDB](http://www.mongodb.org/) in \nconjunction with [mongoose](http://http://mongoosejs.com/).\n\n## Locales\n\nEssential to any production application is the need to have localization support.\n\nAs with controllers and views, rocket puts forward conventions that will allow\nyou to better manage your projects, making sure everything is at its right place.\n\nTo do so, rocket leverage the jade-i18n library by taking each javascript \npackages it finds in the `./locales` directory and then define the phrases it contains.\n\nFor example, to define the phrase *WELCOME_MESSAGE* in *en_CA* you simply create\na file named **en_CA.js** (in the `./locales` directory) containing the following:\n\n    module.exports = {\n        WELCOME_MESSAGE : 'Hello world !'\n      , GOODBYE_MESSAGE : 'Bye world !'\n    }\n    \n### Using locales in my **controllers**\n\nOne of the *suggested* pattern to better leverage jade-i18n in your controllers\nis to use a middleware in order to (1) Detect the language of the client and (2)\nprovide a version of `rocket._` (jade-i18n `_` helper) with a pre-appended \n`lang` argument in order to allow your controllers to simply call `req._` to\ntranslate messages in the client's language.\n\nSuch middleware would look like :\n\n    function(req, res, next) {\n      \n      var current_lang = guessLang(req)\n        ;\n      \n      req._ = function(text) {   \n        return rocket._(current_lang, text);\n      }\n      \n      next();\n      \n    }\n\n### Using locales in my **views**\n\nYou can use the `_` dynamic helper just like you would with jade-i18n. \n\n### Using locales anywhere (else)\n\nThe jade-i18n package is available through `rocket.i18n` and its `_` dynamic\nhelper is available through `rocket._`\n\n## Views\n\nRocket takes care of matching your views to your controllers so you do not have\nto define these redundant relationship.\n\nControllers without view simply returns the JSON passed to `res.send()`.\n\n### Controller/Views mapping\n\nRocket maps controllers to their views in the following way :\n\n    ./controllers/root_controller.js\n        |\n        |- exports.index  = function(req,res) { /* ... */ } --> views/root/root.index.jade\n        |\n        |- exports.custom = {\n               get  : function(req, res) { /* ... */ } --> views/root/root.custom.get.jade\n             , post : function(req, req) { /* ... */ } --> views/root/root.custom.post.jade\n           }\n\n### Bypassing view generation with XHR queries\n\nIn order to serve as RESTful access points, every controller returns JSON\ninstead of its rendered view, when it is queried via XHR (ajax).\n","_id":"rocket@0.5.8","dist":{"shasum":"b6d29fe44217a13e64d4480cb93f863acfab7fe3","tarball":"https://registry.npmjs.org/rocket/-/rocket-0.5.8.tgz","integrity":"sha512-6M/P6/r7q4VpP5DlOC93/f4DIP6c9oIoveXkG5jIQ52bU/VDwvc+gI/oOwWwq36r7kzOPj81Hu4vwRhiUHWf7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDniMZhbY37zAA06YBEwFPz4x27VDD5Yn6lB55cMatNYwIhAPkUrUDvarx5lMG2P7xY1AO6hyfvA1qhj78iObdcXzEP"}]},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}]}},"maintainers":[{"name":"glesperance","email":"gabriel@wavo.me"}],"time":{"modified":"2022-06-26T13:49:29.312Z","created":"2011-05-07T21:15:16.551Z","0.0.0":"2011-05-07T21:15:17.461Z","0.0.1":"2011-05-07T23:07:02.446Z","0.0.2":"2011-05-25T13:01:06.453Z","0.0.3":"2011-06-10T01:37:50.144Z","0.0.4":"2011-06-14T02:17:46.147Z","0.0.5":"2011-06-14T21:08:17.001Z","0.0.6":"2011-06-24T14:21:07.564Z","0.0.7":"2011-06-24T14:25:04.513Z","0.0.8":"2011-06-28T20:13:04.525Z","0.0.9":"2011-06-29T20:25:22.712Z","0.0.10":"2011-08-03T02:03:05.934Z","0.1.2":"2011-08-30T22:23:10.821Z","0.1.5":"2011-09-06T16:13:43.993Z","0.1.6":"2011-09-26T16:39:25.540Z","0.1.7":"2011-09-30T22:49:47.949Z","0.1.8":"2011-10-05T02:46:49.514Z","0.1.9":"2011-10-05T20:35:18.168Z","0.1.10":"2011-10-05T22:21:52.259Z","0.1.11":"2011-10-26T05:39:57.192Z","0.1.12":"2011-10-26T05:42:46.165Z","0.1.13":"2011-10-31T02:23:10.810Z","0.1.14":"2011-11-11T23:59:58.515Z","0.1.15":"2011-11-14T19:29:47.181Z","0.1.16":"2011-11-30T22:59:00.953Z","0.1.17":"2012-01-10T16:34:18.278Z","0.1.18":"2012-02-07T20:05:28.726Z","0.2.1":"2012-03-19T21:09:26.302Z","0.2.2":"2012-04-02T20:41:07.147Z","0.2.3":"2012-04-03T00:07:08.288Z","0.2.4":"2012-04-18T17:38:31.603Z","0.3.0":"2012-04-19T21:15:01.554Z","0.3.1":"2012-04-24T00:33:04.765Z","0.3.2":"2012-05-04T23:43:09.300Z","0.3.3":"2012-06-14T15:58:45.242Z","0.4.0":"2012-06-14T18:04:47.492Z","0.4.1":"2012-06-15T16:45:15.666Z","0.4.2":"2012-07-04T23:57:29.126Z","0.5.0":"2012-07-09T23:18:40.218Z","0.5.1":"2012-07-17T19:50:51.553Z","0.5.2":"2012-07-26T16:36:52.961Z","0.5.3":"2012-08-06T19:50:21.917Z","0.5.4":"2012-08-06T22:10:59.228Z","0.5.5":"2012-08-08T18:47:58.820Z","0.5.6":"2012-10-19T20:32:13.657Z","0.5.7":"2012-12-17T20:36:41.278Z","0.5.8":"2013-01-09T21:47:43.620Z"},"author":{"name":"Gabriel Lesperance","email":"gabriel@wavo.me","url":"glesperance.com / wavo.me"},"repository":{"type":"git","url":"git://github.com/glesperance/node-rocket.git"},"users":{"fgribreau":true}}