{"_id":"declare","_rev":"10-88d121da7fd991164bd9221fdd9ab804","name":"declare","description":"dojo 1.7 based oop utils","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"declare","version":"0.0.1","description":"dojo 1.7 based oop utils","engines":{"node":">=0.4.0"},"author":{"name":"Christoph Hagenbrock","email":"christoph.hagenbrock@comvel.de"},"dependencies":{},"repository":{"type":"git","url":"git://github.com/agebrock/declare.git"},"main":"./index.js","directories":{"lib":"./lib"},"keywords":["declare","oop","class","dojo"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"_npmUser":{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"},"_id":"declare@0.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"30d324ace06bc198b71426c2ca480b05cbcdfac6","tarball":"https://registry.npmjs.org/declare/-/declare-0.0.1.tgz","integrity":"sha512-yTyRWZ7+j68Hu9dFyYTTAw8ygI8jYW3uRawexWDzf3GChJQx5J5D7J5OXyLXhSBbtiS5cEeLsqFa7Yd55CxRpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDpQO3ldd0BG7leHLRkU8ifNZGa4d5AF44/gmu1XNW0gIhAIndfbCT6AK7fRheirSv0My3L4V78qWpKOWIYIUWuGRT"}]},"maintainers":[{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"}]},"0.0.2":{"name":"declare","version":"0.0.2","description":"dojo 1.7 based oop utils","engines":{"node":">=0.4.0"},"author":{"name":"Christoph Hagenbrock","email":"christoph.hagenbrock@googlemail.com"},"dependencies":{},"repository":{"type":"git","url":"git://github.com/agebrock/declare.git"},"main":"./index.js","directories":{"lib":"./lib"},"keywords":["declare","oop","class","dojo"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"_npmUser":{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"},"_id":"declare@0.0.2","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"8eee5ca2ae561d645c40479e3c52eb394e1544cc","tarball":"https://registry.npmjs.org/declare/-/declare-0.0.2.tgz","integrity":"sha512-V5aKlA2LYhUBRDnjCK/dg7SboQBT/eIFfRf5fhdLwmxArIth+0CSqP5c+q01KCT07EFecR1hpUuwgsNgjVF4bA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChH5bR0mo1cMYCYt5iMIbqzn6mHJWuhrrRwmaUR7xsKAIgeaGFmAa3AqBkfaB5GbgTXKQ2EHF8OG91yA6Obcgmz3Q="}]},"maintainers":[{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"}]},"0.0.3":{"name":"declare","version":"0.0.3","description":"dojo 1.7 based oop utils","engines":{"node":">=0.4.0"},"author":{"name":"Christoph Hagenbrock","email":"christoph.hagenbrock@googlemail.com"},"dependencies":{},"repository":{"type":"git","url":"https://github.com/agebrock/declare"},"main":"./index.js","directories":{"lib":"./lib"},"keywords":["declare","oop","class","dojo"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"readme":"/**\nexample/simple.js\n\ndeclare is a node.js optimized version of dojo 1.7's dojo.declare\nThis example shows how to create a namespace and create classes within.\n\nNo global namespace is violated\n\ndeclare includes the folloing modified dojo functions\n\n* declare\n* mixin\n* getObject\n* setObject\n* exists\n* getProp\n\nfor more information check the dojo docs (with dojo. prefix for sure)\n\n\n**/\n\nvar createNamespace = require(\"../index\");\n\nvar myCustomNamespace = {\n    \"doesNotMatter\" : \"anyValue\"\n};\n\nvar oop = createNamespace(myCustomNamespace);\n\n\nvar MYClass = oop.declare(\"my.namespace.MYCLASS\",[],{\n    property:\"value\",\n    constructor:function(){\n        console.log(\"I AM ALIVE\");\n    },\n    methodA:function(){\n        console.log(\"methodA called\")\n        console.log(this);\n    },\n    methodB:function(){\n        console.log(\"methodB called\")\n    }\n});\n\n\noop.declare(\"MYSubClass\",[myCustomNamespace.my.namespace.MYCLASS],{\n    constructor:function(){\n        oop.mixin(this,{methodC:function(){\n            console.log(\"same mixin like known from dojo @\" , this.declaredClass);\n        }});\n    },\n    methodA:function(){\n        console.log(\"method A from \" + this.declaredClass);\n    }\n})\n\n\n\n\n/*\nthis will end up with the same result...\n*/\nvar instance = new MYClass();\n/*\nThe namespace can be accessed with the object we used to create the \"oop\" instance.\nYou could create more factories each with a different namespace\n*/\nvar i2 = new myCustomNamespace.my.namespace.MYCLASS();\n\nvar subi = new myCustomNamespace.MYSubClass();\nsubi.methodA();\nsubi.methodB();\nsubi.methodC();\n\n\n/**\nthis will print nonsense but working output:\n===========================================\nI AM ALIVE\nI AM ALIVE\nI AM ALIVE\nmethod A from MYSubClass\nmethodB called\nsame mixin like known from dojo @ MYSubClass\n**/\n","readmeFilename":"README","bugs":{"url":"https://github.com/agebrock/declare/issues"},"homepage":"https://github.com/agebrock/declare","_id":"declare@0.0.3","dist":{"shasum":"d7ac5f0c2587c1b8da0c05e88927f185546f36bc","tarball":"https://registry.npmjs.org/declare/-/declare-0.0.3.tgz","integrity":"sha512-mGT/ueg8Ub2q8icpX3TxksaRSy0vHmwkhTmuUDCEsFR4cdWLm9k5kGbqlEVLSiChZteLIfc8ZvBfs8rdQ4zHiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp9qcJyCNne9kZKM214uw1fngxzyaNJ3+tCgZKFgMl0AIhALGANs5+RUFSp7+eX8ecP04QXyeKj++D9fIrYllC51aZ"}]},"_from":".","_resolved":"https://registry.npmjs.org/declare/-/declare-0.0.2.tgz","_npmVersion":"1.2.32","_npmUser":{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"},"maintainers":[{"name":"agebrock","email":"christoph.hagenbrock@googlemail.com"}]}},"readme":null,"maintainers":[{"email":"christoph.hagenbrock@googlemail.com","name":"chbrock"}],"time":{"modified":"2024-03-10T06:52:48.247Z","created":"2011-12-11T15:21:18.372Z","0.0.1":"2011-12-11T15:21:20.688Z","0.0.2":"2011-12-26T22:04:51.358Z","0.0.3":"2013-12-27T14:40:26.241Z"},"author":{"name":"Christoph Hagenbrock","email":"christoph.hagenbrock@googlemail.com"},"repository":{"type":"git","url":"https://github.com/agebrock/declare"}}