{"_id":"noode","_rev":"13-79028f42c7a9f7428528937fe153ad28","name":"noode","description":"A javascript class-based system with inheritance and events handling for Node.js.","dist-tags":{"latest":"0.0.63"},"versions":{"0.0.5":{"name":"noode","description":"A javascript class-based system with inheritance and events handling for Node.js.","version":"0.0.5","author":{"name":"Xavier Laumonier","email":"dev@aenoa-systems.com","url":"http://www.aenoa.me"},"repository":{"type":"git","url":"git://github.com/xavierlaumonier/Noode.js.git"},"bugs":{"url":"http://github.com/xavierlaumonier/Noode.js/issues"},"main":"./lib/noode","engines":["node >= 0.4.5"],"licenses":[{"type":"MIT","url":"http://github.com/xavierlaumonier/Noode.js/raw/master/LICENSE"}],"dependencies":{},"devDependencies":{},"_id":"noode@0.0.5","_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"b3c3bd2f9dd1f8bf69077df612bbf403a714347b","tarball":"https://registry.npmjs.org/noode/-/noode-0.0.5.tgz","integrity":"sha512-evewM58Mlqo+I4/1eztzuCwn80IsbSYJ6LBkrPAZ7CxHNMFIN8A/tlHmzLx3CXJoybQVpwHiT+WYlq4RCFMXfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD323cB19ismiKONupMECvpCxSvFqwL64TmjUQdg5D6egIhAJ/nwSehCoXEk8RDgikkmKQxoHaekfPsoyJwWcfpbTtX"}]},"scripts":{}},"0.0.6":{"name":"noode","description":"A javascript class-based system with inheritance and events handling for Node.js.","version":"0.0.6","author":{"name":"Xavier Laumonier","email":"dev@aenoa-systems.com","url":"http://www.aenoa.me"},"repository":{"type":"git","url":"git://github.com/xavierlaumonier/Noode.js.git"},"bugs":{"url":"http://github.com/xavierlaumonier/Noode.js/issues"},"main":"./lib/noode","engines":["node >= 0.4.5"],"licenses":[{"type":"MIT","url":"http://github.com/xavierlaumonier/Noode.js/raw/master/LICENSE"}],"dependencies":{},"devDependencies":{},"_id":"noode@0.0.6","_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"07e93a58e5ed97076aa8316c8b485c53315058d3","tarball":"https://registry.npmjs.org/noode/-/noode-0.0.6.tgz","integrity":"sha512-GtuFSfcGvi03mT5xuASCRIpm3ybxRHaIsMDJ12sFukKgZCXXVAglcGefJTr8lpvd/jjsXwoOS2pXeQvrTQnwOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAtr+BflnC3FNCBXwipfp2Lx34sD3YYgjTTjjvtXLfqAiEA9NYx/q4dI2Mg/CRJkTF3rpxA+ZT0S78eVKEjxNUxiFY="}]},"scripts":{}},"0.0.62":{"name":"noode","description":"A javascript class-based system with inheritance and events handling for Node.js.","version":"0.0.62","author":{"name":"Xavier Laumonier","email":"dev@aenoa-systems.com","url":"http://www.aenoa.me"},"repository":{"type":"git","url":"git://github.com/xavierlaumonier/Noode.js.git"},"bugs":{"url":"http://github.com/xavierlaumonier/Noode.js/issues"},"main":"./lib/noode","engines":["node >= 0.4.5"],"licenses":[{"type":"MIT","url":"http://github.com/xavierlaumonier/Noode.js/raw/master/LICENSE"}],"dependencies":{},"devDependencies":{},"_id":"noode@0.0.62","_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"71dca61101fbd4e4c20b5271c16b0dfacef4d5c8","tarball":"https://registry.npmjs.org/noode/-/noode-0.0.62.tgz","integrity":"sha512-WbicJ2df5r5pYoai4bkLOe3h85XIZbmX3ewqvMT2aaOxp/Afpyxrtmc6sa6Br1tBQsy1792Gc0cJF66RDkpDWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTX08s7jOMZr7vro47rKaMwfZ7LjsB9N9YbPcrTynKBAiBLm+N0duO0QlzV/cXQ+VbELAZo+71j+55e+QICekPggw=="}]},"scripts":{}},"0.0.63":{"name":"noode","description":"A javascript class-based system with inheritance and events handling for Node.js.","version":"0.0.63","author":{"name":"Xavier Laumonier","email":"xlaumonier@gmail.com","url":"https://twitter.com/xavlaumonier"},"repository":{"type":"git","url":"git://github.com/Ulflander/Noode.js.git"},"bugs":{"url":"http://github.com/Ulflander/Noode.js/issues"},"main":"./lib/noode","engines":["node >= 0.4.5"],"licenses":[{"type":"MIT","url":"http://raw.github.com/Ulflander/Noode.js/master/LICENSE"}],"dependencies":{},"devDependencies":{},"readme":"## Noode\n\nA javascript class-based system with inheritance and events handling for Node.js.\n\nEvent system is a little more complex than node one : Events are 'noode.Event' object instances.\n\nHowever the API remains the same as Node.js. Check out node docs to know more about EventEmitter. \n\nDocumentation available for noode at http://www.aenoa-systems.com/docs/noode/\n\t\t\nBased on John Resig Simple JavaScript Inheritance: http://ejohn.org/blog/simple-javascript-inheritance/ for the base Class\n\nBoth John Resig work and Noode.js part are MIT licensed.\n\n\n## Install\n\nNoode is available through npm\n\n```\nnpm install noode -g\n```\n\n\n## Example\n\n\nRun node with example.js to see result of this example \n\n```\n\n// We require the noode module\nvar noode = require('noode');\n\n\n\n\n// A very basic class\nvar Basic = noode.Class.extend({\n\t\n\t// That say hello\n\tsayHello: function () {\n\t\tconsole.log('Hello') ;\n\t}\n\t\n});\n\nvar basic = new Basic () ;\nbasic.sayHello () ; // => 'Hello'\n\n\n\n\n\n// Another basic class with inheritance\nvar BasicChild = Basic.extend({\n\n\t// That say hello too\n\tsayHello: function () {\n\t\tconsole.log('Hello world') ;\n\t\t\n\t\t// We call super method\n\t\tthis._super () ;\n\t}\n\t\n});\n\nvar basicChild = new BasicChild () ;\nbasicChild.sayHello () ; // => 'Hello world', 'Hello'\n\n\n\n// An exemple of some class extending AbstractEventDispatcher to dispatch events\nvar Foo = noode.AbstractEventDispatcher.extend({\n\tconstruct: function( content ){\n\n\t\tthis.content = content;\n\t\t\n\t},\n\t// Here we will dispatch an event\n\tgetContent: function(){\n\t\t// An easy way to dispatch events without creating an Event object, AbstractEventDispatcher will do it for you\n\t\tif ( this.dispatch('getContent', {content: this.content} ) )\n\t\t{\n\t\t\treturn this.content ;\n\t\t}\n\t},\n\t\n\tgetOddContent: function ()\n\t{\n\t\t// The common way to dispatch event\n\t\tif ( this.dispatch( new noode.Event ( 'getContent', {content: this.content} ) ) )\n\t\t{\n\t\t\treturn this.content ;\n\t\t}\n\t}\n});\n\n\nvar foo = new Foo( 'test' );\nconsole.log ( foo.getContent() ) ; // => 'test'\nconsole.log ( foo.getOddContent() ) ; // => 'test'\n\n\n\n// Inheritance again\nvar Bar = Foo.extend({\n\tconstruct: function( content ){\n\t\t// Call the super constructor\n\t\tthis._super('Bar-' + content ) ;\n\t}\n});\n\n\n\nvar bar = new Bar( 'test' );\nconsole.log ( bar.getContent() ) ; // => 'Bar-test'\n\n\n\n// Lets add some listeners\n\n// Here is a callback used for our listeners\nvar callback = function ( event )\n{\n\t// If event parameters dont pleased us\n\tif ( event.content == 'test' )\n\t{\n\t\t// We prevent the default action\n\t\tevent.prevent () ;\n\t}\n};\n\n// We attach our listeners\nbar.on( 'getContent' , callback);\nfoo.on( 'getContent' , callback );\n\n// Lets try our listeners\nconsole.log ( bar.getContent() ) ; // => 'Bar-test'\nconsole.log ( foo.getContent() ) ; // => undefined\n\n\n\n\n\n\n//Lets create our own event\nvar OddEvent = noode.Event.extend({\n\t\n\tconstruct: function ( parameters )\n\t{\n\t\tthis._super ( 'oddEvent' , parameters ) ;\n\t},\n\t\n\tgetOddEventThing: function ()\n\t{\n\t\treturn 'That\\'s odd' ;\n\t}\n\t\n});\n\n// The class that will dispatch the OddEvent\nvar OddClass = noode.AbstractEventDispatcher.extend ({\n\t\n\tdispatchOddEvent: function ()\n\t{\n\t\tthis.dispatch ( new OddEvent() ) ;\n\t}\n\t\n});\n\n\nvar odd = new OddClass () ;\n\n// We listen to our event\nodd.on('oddEvent', function ( event )\n{\n\t// Test event\n\tconsole.log ( event.getOddEventThing () ) ;\n});\n\n// and dispatch it\nodd.dispatchOddEvent () ; // => 'That's odd'\n\n\n```\n","readmeFilename":"README.md","_id":"noode@0.0.63","dist":{"shasum":"4f471a9be2e94b4b85ecb1685effac71bd388eda","tarball":"https://registry.npmjs.org/noode/-/noode-0.0.63.tgz","integrity":"sha512-fcdZ8IIbIBFtWn2eK576bvl1TPXS4QaVOTsx4yKwtrLv5DGe4WbmXeZeiBA1LVnOdzjq7LM7t6KWNOel0EfvLw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu0col30CRIgw0QiaRy1GMg/UjnK4ZO5gFvjZlYEO51AIga/Djb8b9lNBWh1eS/XVzaq2tTw6+WpriMGq+OlLBcgg="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"xavierlaumonier","email":"dev@aenoa-systems.com"},"maintainers":[{"name":"xavierlaumonier","email":"dev@aenoa-systems.com"},{"name":"ulflander","email":"xlaumonier@gmail.com"}]}},"maintainers":[{"name":"ulflander","email":"xlaumonier@gmail.com"}],"time":{"modified":"2022-06-22T05:02:11.487Z","created":"2011-06-09T05:13:43.063Z","0.0.5":"2011-06-09T05:13:43.712Z","0.0.6":"2011-06-09T05:29:56.573Z","0.0.62":"2011-06-14T06:56:32.865Z","0.0.63":"2013-10-21T20:59:27.299Z"},"author":{"name":"Xavier Laumonier","email":"xlaumonier@gmail.com","url":"https://twitter.com/xavlaumonier"},"repository":{"type":"git","url":"git://github.com/Ulflander/Noode.js.git"}}