{"_id":"bar","_rev":"12-e3af18e601395bc2c542b927b6b40b4f","name":"bar","description":"Node.js framework for building large modular web applications","dist-tags":{"latest":"0.1.2","stable":"0.1.2"},"versions":{"0.1.0":{"name":"bar","description":"Node.js framework for building large modular web applications","version":"0.1.0","author":{"name":"Fedor Indutny","email":"fedor.indutny@gmail.com"},"dependencies":{"watch":">= 0.3.2","eventemitter2":">= 0.1.3","optimist":">= 0.2.4"},"bin":{"node-bar":"./bin/bar"},"main":"./lib/bar","scripts":{"test":"vows --spec tests/*-test.js"},"_id":"bar@0.1.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"366da8596a5f8aa926b2e454d206c0f606a54584","tarball":"https://registry.npmjs.org/bar/-/bar-0.1.0.tgz","integrity":"sha512-0Y/cazq4atvqRo4dz+vZgjHJaih4kQhU+EwFuDmERxUY61LDN7Qp3mIwkJWIv6HfDXOQsaZQyByK7DSpW7QMZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZHrsCbmYjs+WCiYhvwiGlLSUClQu4DQ0KDKw+hLtCuAiBP0BH+94WjTmbb1+RxmV5COVAudmX+R0wZnYuVlG4Waw=="}]}},"0.1.1":{"name":"bar","description":"Node.js framework for building large modular web applications","version":"0.1.1","author":{"name":"Fedor Indutny","email":"fedor.indutny@gmail.com"},"dependencies":{"watch":">= 0.3.2","optimist":">= 0.2.4"},"bin":{"node-bar":"./bin/bar"},"main":"./lib/bar","scripts":{"test":"vows --spec tests/*-test.js"},"_id":"bar@0.1.1","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"f98a2fc5343d9f844bafb17f5d382549dcd5c7a9","tarball":"https://registry.npmjs.org/bar/-/bar-0.1.1.tgz","integrity":"sha512-sNAWnvKJFg4yMuC/jCWcZAnOhNrvhH4wDsgqguqQpi1cJzOj+DPbY3ldwDNiZHHx6YnjWUthsUlpmRsdGkMR7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAp8yOSqH4KozT33vorqiaxlA+yuT78ww7ggttTMBb0FAiBVvZDm3sNHsg8RO6UoUiZLtLghGHVymTNK562VIaXV/A=="}]}},"0.1.2":{"name":"bar","description":"Node.js framework for building large modular web applications","version":"0.1.2","author":{"name":"Fedor Indutny","email":"fedor.indutny@gmail.com"},"repository":{"type":"git","url":"git://github.com/indutny/bar.git"},"homepage":"https://github.com/indutny/bar","license":"MIT","dependencies":{"watch":"~ 0.3.2","optimist":"~ 0.2.4"},"bin":{"node-bar":"./bin/bar"},"main":"./lib/bar","scripts":{"test":"vows --spec tests/*-test.js"},"devDependencies":{"vows":"~0.7.0"},"readme":"# Node.js Bar\n\n<img src=\"https://raw.github.com/indutny/bar/master/bar.jpg\" />\n\n*Http-server goes into a bar*\n\n# What is Node.js Bar?\n\nNode.js Bar is a [node.js](http://node.js.org) framework for building large modular web applications.\n\n# How does it work?\n\n**Bar** can be run in any folder, all javascript files in that folder will be transformed to **drinkers** and then runned as a part of Node.js Bar. Bar have a **pool** full of drinks. Every drinker has a **pint** which is a merely the same thing as a **pool**, but smaller and with local features.\nSo in, basically, **pint** and **pool** are both the same [EventEmitter2](https://github.com/hij1nx/EventEmitter2) instance. Because of that, drinkers can communicate with each other by **emitting** and **listening** events.\nAt any time drinker can leave and enter **Bar**. That process is essentially the same as the **Module autoreload** process.\n\n## Where can I run Bar?\n\nAs I said before, **Bar** can be run at any folder. You only need to have it installed globally using [npm](https://github.com/isaacs/npm)\n\n# Installation\n\n```\n[sudo] npm install bar -g\n```\n\n# Documentation\n\n## Drinker API\n\nEvery drinker can access **pool** methods: `on`, `emit`, `addListener`, `removeListener` and etc. They're exposed to global context (*Drinkers are running in separate contexts*).\n\n```javascript\non('some-event', function() {\n});\n\nemit('some-event', someData = {a: 1});\n```\n\nAlso `name`, `hook`, `snap` methods are exposed to global context.\n\n## Name\n\nEvery drinker should introduce itself by calling `name`. Only letters, digits, underscores and hyphens can be used for a Drinker's name.\n\n```javascript\nname('your-drinker-name');\n```\n\n## Drinker events\n\nAt any time, when drinker's code was changed - Bar will immediately emit `leave.${drinker.name}` event and create new drinker to replace old one. All event handlers attached to Bar's **pool** will be removed before that.\n\n```javascript\nname('drinker-name');\n\non('leave.drinker-name', function() {\n  // This method should act like destructor and detach/remove all data\n  // Close all file descriptors opened by Drinker and etc.\n});\n```\n\n## Hook&Snap\n\nThere're two method for building persistent relationships between two Drinkers: `hook` and `snap`. `snap` will pass arguments to `hook` callback regardless of the order in which they were called.\n\n```javascript\nname('hook');\n\nhook('beer', function(from, amount) {\n  // Do something with {amount} of beer\n});\n```\n\n```javascript\nname('snap');\n\nsnap('beer', 'Bob Smith', 10);\n```\n\nYou should use `hook` and `snap` pattern to share objects between multiple drinkers.\n\n## More info\n\nTo find more info look at examples.\n\n#### Author: [Fedor Indutny](http://indutny.com/)\n\n\n## Credits\n\nImage by [Creatunco](http://creatunco.deviantart.com/)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2013.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"bar@0.1.2","dist":{"shasum":"ec36d80c5fea1111fe1e32c9db38a61053225155","tarball":"https://registry.npmjs.org/bar/-/bar-0.1.2.tgz","integrity":"sha512-FlFXS7BOkkjSMeNnX7uB2ZPGJw/6PFFQRCMZdMyMct41v7Jj9xwgNKYiZkkuhOCiiN4hdTZzLbddb38MLfTPFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5L2x+gToU91xKwx1athlCpi/+nYdm1p9ts4K/P2fhmwIhAKgt7LORbVzGHneOj2R2uLJWsYYap3SGwjmUrvPnFD13"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"fedor.indutny","email":"fedor.indutny@gmail.com"},"maintainers":[{"name":"fedor.indutny","email":"fedor.indutny@gmail.com"}]}},"maintainers":[{"name":"fedor.indutny","email":"fedor.indutny@gmail.com"}],"time":{"modified":"2022-06-13T04:15:25.873Z","created":"2011-06-19T10:21:47.871Z","0.1.0":"2011-06-19T10:21:49.805Z","0.1.1":"2011-06-19T10:39:17.723Z","0.1.2":"2013-02-10T12:51:21.187Z"},"author":{"name":"Fedor Indutny","email":"fedor.indutny@gmail.com"},"repository":{"type":"git","url":"git://github.com/indutny/bar.git"}}