{"_id":"brave","_rev":"13-a31b7e9f1ab887c43b607f63b5da4acb","name":"brave","description":"Old school web application library","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.1":{"name":"brave","version":"0.0.1","description":"Old school web application library","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"browserify component/address.js  -d -o component/address.bundle.js","build:todo":"browserify component/todo/todo.js -t jstify -d -o component/todo/todo.bundle.js","build:blog":"browserify component/todo/blog.js -t jstify -d -o component/todo/blog.bundle.js","watch":"watchify component/address.js -d -o component/address.bundle.js","watch:todo":"watchify component/todo/todo.js -t jstify -d -o component/todo/todo.bundle.js","watch:blog":"watchify component/todo/blog.js -t jstify -d -o component/todo/blog.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"resigify":"1.0.0"},"_id":"brave@0.0.1","_shasum":"7efba1da667cf2b87c03552b2a679a74f92cff3e","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"7efba1da667cf2b87c03552b2a679a74f92cff3e","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.1.tgz","integrity":"sha512-ySFIeKUGVIt0rVShvaV4thAx2BVegADKYZDMfB9dv9CegCT9hsZKegb3Uex1Bvup1ZnqNAhNZeYCWPJF+RmDSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDi0whQpDEECxwv07iNTlQCrlz9bEm1mCFqxf8MBrxK0QIhAJYPZy264iRVpxNwRdVFk4d9tFmOU3lnOihVhm+o7QJq"}]}},"0.0.2":{"name":"brave","version":"0.0.2","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"gitHead":"5d6aabbbb8bc2cfbe73f5c71d9d7b2e864a2c695","_id":"brave@0.0.2","_shasum":"7ce3a6c06d93bf876334e86426d6d6c3f463c968","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"7ce3a6c06d93bf876334e86426d6d6c3f463c968","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.2.tgz","integrity":"sha512-M8af7yfv5jZkAo79LNiwjvWMBSuzsnyWINM7OkCXI8QaX5NmInkNw83w5dRVpiVaxQuFqELV4QBpHbKOMGcwxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFh9zo67aMtFBMC58yNVmAEl7jAAXyu72mj4kUa44qzuAiAv1FxOn/+jxAFLaMq2TP/jiDjeHKy8bTGEQZz7IydXBw=="}]}},"0.0.3":{"name":"brave","version":"0.0.3","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"gitHead":"e947edb17ba16e61e9d91c0695d324b167e95620","_id":"brave@0.0.3","_shasum":"46267eb7168ebad6c4a961453c576872e0bd9801","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"46267eb7168ebad6c4a961453c576872e0bd9801","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.3.tgz","integrity":"sha512-UisenQQ4EO+dbbQnpRxz7EX88tyTPP2r+S3YQjEDHjtCcHb7a+wkEs5f7dHZMyVH8oMGOc2Fm0pMvK2XE3kFlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEanjljQr7/zaw1edwBLhmonwukMbLH8BEsGSw6R8/umAiEAkcyJgaobPOSRskwHL62TtrNLv+ItCtuE7R6mak7pGcE="}]}},"0.0.4":{"name":"brave","version":"0.0.4","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"db9d72c23b750164e7b9c6dce69c4f8728f8f5f0","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.4","_shasum":"132004969e6a1e3c9320f464b5530fff762be0f8","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"132004969e6a1e3c9320f464b5530fff762be0f8","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.4.tgz","integrity":"sha512-4UcFxLWkioYBvvpDF6787VObYp4t0/8nre1c/UfWBLoejndtsSTOjCwMzVE3PsDY1WBTASaHVHzCXHu63xw2GQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeB6NbVO4Hwu0OT4swxG175Av1aAFCbrLC8Y0mgFlFnwIhAMijPDrX6uHwBtJ2t1J9ey8HFAnyPBOaRZ+P6vWZ5tph"}]}},"0.0.5":{"name":"brave","version":"0.0.5","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build1":"browserify index.js -o -d --standalone Brave > dist/brave.js","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"d51b2380aec580798710be775c477c3df94e3ec6","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.5","_shasum":"40111052e7c3738c6d9fa0cbcc1e78e4ff35e35a","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"40111052e7c3738c6d9fa0cbcc1e78e4ff35e35a","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.5.tgz","integrity":"sha512-yKJPMfTt9oFBfb8axhy1zNSS256OyL72ByoZcTKKiqc12eIU5+BGJWLJ/08vvxb4/sG+8f4Dma73qrG/DsF9Lg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYCUBjHgD2gvsf6GFindDH7VwVAa1EnNJxZ1aplLoa5wIhAJLPAvlhow69nbk6Sz74DNsUhANBomZiyChNR9h0evt2"}]}},"0.0.6":{"name":"brave","version":"0.0.6","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build1":"browserify index.js -o -d --standalone Brave > dist/brave.js","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"6b191155b3449267deb2ab9de3c10373be04406a","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.6","_shasum":"ae0ded4ca75461a31ecbc40ac9b162c45872f240","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"ae0ded4ca75461a31ecbc40ac9b162c45872f240","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.6.tgz","integrity":"sha512-3MGikcnTuQu8g/RtNDHhhKXYw91LpH2LsCNz87VSKaAiyoXqVFK7vzrw8fC0jvj+D68DxKY8592XLjPjIMYTfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCVMvlOUKT+tKQeOsXF5jk3KoFNyS3SPq3jX+uL9YPuAiEAypchDpu+eTOsxDk+d1CgRRf33YzWvZUDBwt2WqE4rmg="}]}},"0.0.7":{"name":"brave","version":"0.0.7","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build1":"browserify index.js -o -d --standalone Brave > dist/brave.js","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"6b191155b3449267deb2ab9de3c10373be04406a","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.7","_shasum":"07cd4410e47b2dcf9a3d484340727a22ca6ceda5","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"07cd4410e47b2dcf9a3d484340727a22ca6ceda5","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.7.tgz","integrity":"sha512-jEhYhYxhfU56iZEAZxpplMEHiw30x1HjXsFD5I18GEdokYaHNU5bMShOE2g4Xf2hmrN31LTLdEIBL1nEeUs7Kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIJrDDgr1z++JUyvBA9xODaFlht2vb3jkKJEXUFBkkDAiAF0oC331RoIc+3ul+p1XAkG/YfD4/AbD5pv8q7Ziv26Q=="}]}},"0.0.8":{"name":"brave","version":"0.0.8","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build1":"browserify index.js -o -d --standalone Brave > dist/brave.js","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"a69f2005b57e8e0d183766c795d79cd67c498233","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.8","_shasum":"af672bec0de3bd1ae895cb407edf62b4f8216d14","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"af672bec0de3bd1ae895cb407edf62b4f8216d14","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.8.tgz","integrity":"sha512-u3Q4fZ7lZqR4ZDSCvOr1T6/+2UxfyzNyyNbcaPTM2EOCM+5AtX2taNXRY4WMvR5gwO8mkQr24Rrn9z2WswV1+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0pAZ+/dzTAxoLxGlu1crrbxERpfHwRtmjjUd3y4IJRwIhAN6jF/omUDgZCj959EMFOueStjafzsXRJBrfEzyCTzCZ"}]}},"0.0.9":{"name":"brave","version":"0.0.9","description":"Old school web application library","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build1":"browserify index.js -o -d --standalone Brave > dist/brave.js","build":"bin/build","build:todo":"browserify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","build:blog":"browserify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","build:supermodels":"browserify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js","watch:todo":"watchify examples/todo/index.js -t resigify -d -o examples/todo/todo.bundle.js","watch:blog":"watchify examples/blog/index.js -t resigify -d -o examples/blog/blog.bundle.js","watch:supermodels":"watchify examples/supermodels/index.js -t resigify -d -o examples/supermodels/supermodels.bundle.js"},"author":{"name":"davidjamesstone"},"license":"ISC","dependencies":{"dom-delegate":"2.0.3","get-object-path":"0.0.2"},"devDependencies":{"browserify":"12.0.1","exorcist":"0.4.0","resigify":"1.0.0","supermodels.js":"0.0.7","uglifyjs":"^2.4.10","watchify":"3.6.0"},"repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"gitHead":"4105844b88d18143d7c7bf44e01bf1bf438e6dea","bugs":{"url":"https://github.com/davidjamesstone/brave/issues"},"homepage":"https://github.com/davidjamesstone/brave#readme","_id":"brave@0.0.9","_shasum":"40508a6e015a340197ceb94f81365eace3bd5821","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"},"maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"dist":{"shasum":"40508a6e015a340197ceb94f81365eace3bd5821","tarball":"https://registry.npmjs.org/brave/-/brave-0.0.9.tgz","integrity":"sha512-E78demnscww8PiFLo5Y/r/Pv6V2PG03/u4NPkJGfqGA9u+DopEuxB2ZXoo4PmcxcwEzk09U1PrLn09DyNvB2gA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/hIPW/3xqSA63kr/WA1IpAGC+pU4bQk1mAs5W7HiQNwIhAPdFoq6kTB6/vBOiAxCSUu9pMAbpkfHHIBmjfryFDHwc"}]}}},"readme":"# brave\nTiny web application library\n\nSuper simple library that helps with building websites.\n\nFeatures:\n- Attaches JS behaviors to DOM elements\n- Backbone-like component definitions\n- jQuery-like like event delegation\n- Angular-like scopes\n- Easy element referencing using aliases\n- Unobtrusive. DOM attribute based selectors\n- Tiny **3K minified/zipped** file size\n\nSo, what does it do?\n\n- Allows you to define DOM components using javascript\n- DOM scopes for components that can be isolated or can `inherit` from their parent\n- Component level event delegation like jQuery `live`\n- Elements can be aliased onto their scope to avoid document.getElementById calls\n\n```html\n<div my-app>\n  <h1 as=\"headingEl\"></h1>\n  <form my-login=\"userData\" as=\"formEl\">\n    <input type=\"text\">\n    <input type=\"password\">\n    <button as=\"buttonEl\">Login</button>\n  </form>\n  <div my-widget=\"widgetData\" as=\"widgetEl\"></div>\n</div>\n```\n\n```js\nBrave.register({\n  'my-app': {\n    initialize: function () {\n      this.headingEl.innerHTML = this.data.appName\n    },\n    showMessage: function (message) {\n      alert(message)\n    },\n    sayHi: function () {\n      this.showMessage('Hello from app')\n    },\n    get someProp () {\n      return 'I\\'m on the the app\\'s prototype'\n    }\n  },\n  'my-login': {\n    initialize: function () {\n      console.log('my-login')\n    },\n    on: {\n      'submit:form': function (e) {\n        e.preventDefault()\n        this.login()\n      }\n    },\n    login: function () {\n      this.showMessage('Logging in...')\n      this.showMessage('I can call my parent scope\\'s methods and properties')\n    }\n  },\n  'my-widget': {\n    initialize: function () {\n      console.log('my-widget')\n    },\n    template: function () {\n      // This will be rendered when components are initialized.\n      // Notice how child components can be created e.g. `my-widget-item`\n      var str = '<ul>'\n      for (var i = 0; i < this.data.length; i++) {\n        str += '<li my-widget-item=\"[' + i + ']\" as=\"listItem_' + i + '\"></li>'\n      }\n      str += '</ul>'\n      return str\n    }\n  },\n  'my-widget-item': {\n    initialize: function () {\n      console.log('my-widget-item')\n    },\n    on: {\n      click: function (e) {\n        this.showMessage('Widget item clicked')\n      }\n    },\n    template: function () {\n      return '<a as=\"item_' + this.data +'\" href=\"#\">' + this.data + '</a>'\n    }\n  }\n})\n\nvar data = {\n  appName: 'My App',\n  userData: {\n    userName: 'Jane',\n    password: 'secret'\n  },\n  widgetData: [1, 2, 3]\n}\n\nBrave.scan(document.body, data)\n```\n\nHere's the [result](https://jsfiddle.net/zpufwck1/1/) of this example\n\n\nIt's enough to start building quite some interesting applications. `brave`s main aim is to application structure by defining web component behaviors allowing you to take control of the DOM.\n\nNo two-way binding, or automatic DOM updates are done, how you do this is down to you. There are plenty to options available if you want to use another library alongside or it can just be done the old fashioned way with `event`s. Manually handling DOM updates and managing state yourself can be a chore but there can be lots of benefits over using frameworks in the long run. Building strong models that represent the data on the front end, using a tool like `brave` to organize and build your controllers/scopes can yield a nice clean code base that's easy to reason about.\n\n`brave` is not a template library. How you generate HTML is down to you ([resigify](https://github.com/davidjamesstone/resigify) is used in the [Examples](examples)). `brave` works by querying the DOM to look for attributes that match components you have registered. During this query it initializes any components it finds and attaches the behaviors such as events. If a component itself renders some more DOM while initializing, its' new children will then also be processed.\n\nWhilst this processing happens a scope chain of controllers is being built. These are simple JS prototype chains and work in a similar fashion to AngularJS directives in that a components scope can be either isolated or `inherit` from their parent scope.\n\nIf you haven't used Angular before or any of this doesn't make sense don't worry, there's no steep learning curve.\n\n`brave` works well with both client and server generated HTML, has barely no learning curve and plays well with any other javascript libraries and template engines.\n\n`npm install brave --save`\n\n`var Brave = require('brave')`\n\nIf you aren't using `browserify` simply include `dist/brave.js` in a `script` tag and it will export `window.Brave`\n\n## Components\nAn object representing the component. Any custom properties and functions will form part of the `scope`'s prototype. Additionally it can contain the following 4 special properties:\n\n### `on`\nObject map of events.\n\n```js\n{\n  on: {\n    'click': function (e) {},\n    'click:ul li a': function (e) {},\n    'submit:form': function (e) {},\n    'change:input': function (e) {},\n  }\n}\n```\n\n### `initialize` [function]\nA function that will be called when the component is being initialized.\n\n### `template` [function|string]\nA HTML string or function that returns a HTML string.\nThe function will be passed the current `scope`. The innerHTML of the element will be set and then `scan`ed.\n\n### `isolate` [boolean(false)]\nA Component's scope prototype will inherit from its parent by default. Set this to `true` and the scope will be isolated.\n\n## Scopes\nWhen a component is initialized a scope is created. That scope will contain on its prototype the custom properties of the component object and any `inherited` properties (unless it's isolated). A scope will also contain these properties:\n\n- `data` - The data object passed in the call to `scan`\n- `render` - Can be used for re-rendering. Only present if a `template` was defined on the component\n- `__` - This property holds the component information (`isolated`, `on`) etc. Could be useful if you need to reference the component that was used to create the scope.\n\n## register\nUsed to register a component or components.\n\n`Brave.register('name', componentObject)` or `Brave.register(componentsObject)`\n\nE.g.\n\n```js\nBrave.register({\n  mywidget: {\n    on: {\n      'click': function (e) {}\n    }\n  }\n})\n```\n\n## scan\nQuery the DOM for components and initializes them.\n\n`Brave.scan(el, [data])`\n\nElements are queried for attributes names matching component name.\nThe value of the attribute can make a reference `data`. E.g. `foo` here:\n\n```html\n<div mywidget=\"foo\"></div>\n```\n\n```js\nvar data = {\n  foo: {\n    bar: 1,\n    baz: 2\n  }\n}\n\nBrave.scan(document.body, data)\n```\n\n## Aliases\nDOM elements can be projected onto their scope by giving them an `as` attribute\n\n```html\n<div mywidget=\"foo\">\n  <input as=\"searchEl\" type=\"text\">\n  <button as=\"searchButton\" type=\"button\">OK</button>\n</div>\n```\n\n## Example\n\nSee the [Examples](examples)\n\n## Notes\nA similar technique was used by Paul Irish who coined the name [DOM based routing](http://www.paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/)\n","maintainers":[{"name":"davidjamesstone","email":"davidjamesstone@gmail.com"}],"time":{"modified":"2022-06-13T05:05:03.133Z","created":"2015-11-11T21:02:01.182Z","0.0.1":"2015-11-11T21:02:01.182Z","0.0.2":"2015-11-16T00:40:01.807Z","0.0.3":"2015-11-16T00:46:13.483Z","0.0.4":"2015-11-16T23:09:27.313Z","0.0.5":"2015-11-18T21:38:36.998Z","0.0.6":"2015-11-18T21:47:35.305Z","0.0.7":"2015-11-18T21:52:41.976Z","0.0.8":"2015-11-18T23:40:42.631Z","0.0.9":"2015-11-20T00:32:02.234Z"},"author":{"name":"davidjamesstone"},"license":"ISC","readmeFilename":"README.md","keywords":["web","dom","delegates","events","backbone","jquery","DOM-based Routing"],"homepage":"https://github.com/davidjamesstone/brave#readme","repository":{"type":"git","url":"git+https://github.com/davidjamesstone/brave.git"},"bugs":{"url":"https://github.com/davidjamesstone/brave/issues"}}