{"_id":"structr","_rev":"167-0014e16789968d583a3d1815c7ae065d","name":"structr","dist-tags":{"latest":"0.3.2"},"versions":{"0.0.1":{"name":"structr","version":"0.0.1","_id":"structr@0.0.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.12-1","_nodeVersion":"v0.4.8","dist":{"shasum":"4a279ea68740520c86d7a744a3bb6701e69b77c5","tarball":"https://registry.npmjs.org/structr/-/structr-0.0.1.tgz","integrity":"sha512-tV2qrr7ernkb5dRga13ckRrljZMgfGIStPqn63Hrsw9U4QPJZqrVMqI+K7LI4n5fdA1qUpaC+cwtLdH+0bnoIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEaJ4Icnto40OScjh47nRpyfjqEejUbrwTXzEYvDVh8gIhANQQofa/3GCFaj3Z+nem3I8PEmrs7Tkp9mAY7b7ZN4+D"}]},"directories":{}},"0.0.2":{"name":"structr","version":"0.0.2","_id":"structr@0.0.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.12-1","_nodeVersion":"v0.4.8","dist":{"shasum":"4cec48ec5fe4f760d1748ea108a7a666aa30b911","tarball":"https://registry.npmjs.org/structr/-/structr-0.0.2.tgz","integrity":"sha512-vAIJ0y4Y51B//B9qqVZcJ751ywy4xDxGIl6n/jaL0/jge+901+L0L0bLmTeoMtEspXZvCnmDI4vC/kJPGpxQ4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzLDbY/iK0Vg7lYxIC+eaGXrO4M5axwpsLKAy0Blf5HQIhAKmnYkyPdr2Cl00h7qDM0hL+8SGSi72SCr7YFztnJe1q"}]},"directories":{}},"0.0.3":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.8","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.3.tgz","shasum":"d920c5d8b2116c75a39ab6c6e2902df339792e8b","integrity":"sha512-DWNin3kn4738G+bV+CUDSX9OcTmc6YwGFiYvyEU8cqBS+MHvnzhDLF3sEpkq2H3uEi1fGOARXAecUQKhkMTqMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChVNYY+kZHeXuAQmqK+BLw1V84BenmjH7V55q/FSW2IQIgSlqsuFQvKEXLYMFjNg1idxnOBntNNhnFAJYIJKYz/GU="}]},"directories":{}},"0.0.4":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.4","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.9","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.4.tgz","shasum":"06f72fd8a3f91659786ee79394841e38f68979e0","integrity":"sha512-Yeufk3o03zxVusVvHbrJS9VBOMUQtPOKbjWyLdY/raAqHyJ79RHtnOv6CO0/2NCHPgyBQRXJiD3+e70ReitZgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGr3PdOmv5s8X+FkNVHF8wxCYbijMAZKG2f7xv5kxREAiEA3zkbzbpsyJzBhZhh6Wpgm8sXowwp6kIEaNnykB2TIAc="}]},"directories":{}},"0.0.4-1":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.4-1","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.4-1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.9","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.4-1.tgz","shasum":"80248ac81e336442ee949a8ad4decc44936a6a79","integrity":"sha512-9aGLMn6Rs0QSGehhxbkwxCSgJxqh2pEVBTpjki4WO/fqwru88ZXi7/uN+yBToliBoCt3APZggx9he1ixLlCWVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPquavyvuNkraeGBv1IF0uI2fTONtiprQ3iqs/1BtIWwIgKqx2v2XgoEqy7DQ6QD8i9WlLyiHSdeNGK3PYV6Xh07c="}]},"directories":{}},"0.0.4-2":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.4-2","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.4-2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.9","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.4-2.tgz","shasum":"deb9ee97dda26fd334329b26fa2b6f3271f083c1","integrity":"sha512-vXOEk4plWLuwqQ/7ctYsXm+kJKCtZ8L/gsdyjNqqYUxmjUbEFB2qSkA+j5r/mojQ4eKDQOk3I6CIq3mlWSUHxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDci7mZaXXRVIIU/tAXeaVFaz7xAbXaNyowrLI9amLLHQIhAML08HRe9STICxoel30LyWj1ctGeRK/bmv4wEPxg6mE3"}]},"directories":{}},"0.0.4-3":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.4-3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.4-3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.9","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.4-3.tgz","shasum":"655f6f5a9e4c2acf188918763b1d7f11135dbe8c","integrity":"sha512-mGsPt5f0PzZcLt+dv++bhTpaajIKkRjFDQcSO50hqiyPuqK7o+7/SVPAjrGvlQuDxybswI8ppf4Hf6Esvh9nVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAbDFM9qWYIMoH8LpkI1WfxWtOCa4rg4Hl6Zja13X4uAiEAihrGcfrAhw3gnyCMQoyFatXCjue0AKFeRPTQhgWhhEg="}]},"directories":{}},"0.0.5":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.5","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.5","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.10","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.5.tgz","shasum":"c09b81123c45ee6b02c96da489762a63d415c8c2","integrity":"sha512-HoyjLYLx8bcSq9LxgHwxoktdmkkri0qkYN/0FcQSNOwtPM9FzckZxLDGy2DfHMX5bYTA7T6fossKxtYeKCY7oA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZfZVHVxJUX5sYzPn0mLz/D5kmk2kPfOePUCeKziXc/AIgSZFxbbLccNDsNKxIBvQJkQQbw5GD1InyCkKXiU9HpOI="}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.0.8":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.8","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"structr","_id":"structr@0.0.8","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.4.10","dist":{"tarball":"https://registry.npmjs.org/structr/-/structr-0.0.8.tgz","shasum":"ea61b229971001b3943a027b700094f65ee55185","integrity":"sha512-LXhj9NK+3BtNupBDuzxJOWq6PMKVWogs7N3sGQtAO+QB1cOjJtW9EdjRU9RX6YbjwjKVKH1TLqBuUXUSIx0/cA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtXc8kaTjG1y+xF7avWQCwbvrPpdTMdmxV3oFuT4nkWQIhAMm2+0eLm6krKz0wFljuocJS9hwzbfSK5BisZNgjXzdI"}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.0.10":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.0.10","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"git://github.com/spiceapps/Structr.git"},"main":"./structr.js","_npmJsonOpts":{"file":"/Users/craigcondon/.npm/structr/0.0.10/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"structr@0.0.10","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"3a13ed5002d4503c2e393e022c1796a753482205","tarball":"https://registry.npmjs.org/structr/-/structr-0.0.10.tgz","integrity":"sha512-a8ykromEnPixGeI/NaQJ92uBjP8/vavsF4L9FBC4CySNL2jhUcD6nac8fjhmGi/85v7JQkPNGMrS3T+Nedn0kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9DU7HB7p3kQc4ks4oKbVJThcccSWVGyDjAs4grO3x+gIgLHLspybQzRopX/wW2Rg6pyMhWKkkL2kn/5HdRwrD02o="}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.1.0":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.1.0","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"git://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"_id":"structr@0.1.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.6","_defaultsLoaded":true,"dist":{"shasum":"b8204872db7612d18009e04cb71657ac033a57d9","tarball":"https://registry.npmjs.org/structr/-/structr-0.1.0.tgz","integrity":"sha512-O967ErPtwkBtgPQArDs504fR2G/877pIBRLmKk5r+vx+2rlRZvmMHaGD1ujc+RE4Ls3Ms48sZdEqt+cP4haY3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCgYIlLR2KWQNycGbCFIayFDDHoKUR2MuiCbaP4ZrOLAiArN0e4miE2NNoWU3M6xHR7fknMbC/EBQ6geBhW5u2tRA=="}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.1.3":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.1.3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"git://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"_id":"structr@0.1.3","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"f51ae6ee982470322e4e8e2e83904bd4f95366d2","tarball":"https://registry.npmjs.org/structr/-/structr-0.1.3.tgz","integrity":"sha512-znPaOEu3fGRRboN+Kv+WCTlyONdoXahDJBlN9Gp38RcF0nJMGVfOh1z9vUOSBUkqVRrbhjMtDw1IbMIR9KpvsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZxho9ip75XqUD7do8uKcnT+iCgW1gByoEjLi6mCZJlAiEAtgbLEP/CH2E/yQLCeBAbYjD8RvcP54CfdWdgbX5DeUU="}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.2.0":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.2.0","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"git://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"_id":"structr@0.2.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"8fad6d74b4c1295ad80d0aeb7752d37f297ecf16","tarball":"https://registry.npmjs.org/structr/-/structr-0.2.0.tgz","integrity":"sha512-2SncwQAUDppBqLtMFXjDm95cEZaUCN+gCpYWZUzozT674mZTKe0nc+MT1MZtxCFAXUnWiqGFCtJw07Jec0hBwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICD1B+DjHtJwDdVeudE5f1tK7O+XByXPx+0G6dMxyyfjAiEAgEUa+U8cxFIsAaO8F2fzFiiiE3fsg8xlddYJHBYMqvY="}]},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.2.2":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.2.2","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","readme":"Structr -  Structure for Javascript            \n======================================== \n\nStructr is a framework with the following goals:\n                                               \n* Lightweight.\n# Fast.\n* Provide as few new concepts as possible coming from OOP.\n* Easy to learn.\n* Help develop re-useable, clean, and consistent code.              \n* Reduce the amount of reduntant/boilerplate code.  \n\n\n### Supported Operators:        \n                                             \n* _super                                     \n* inheritance      \n* overloading methods\n* Implicit / Explicit getters & setters\n* Override, and Static  \n* abstract methods\n* add your own custom operators (mixins)\n\n\n### Third-party mixins\n\n* [asyngleton](/crcn/asyngleton.js) - asynchronous singletons\n* [step](/crcn/structr-step) \n                           \n\n\n### Installation\n\nNode.js: \n\n\tnpm install structr\n\t\t   \n\t\t\n### .structr([...parents], classObject)\n\n\n```javascript\n\nvar EventEmitter = require(\"events\").EventEmitter,\nstructr          = require(\"structr\");\n \n/**\n * create a mouse class which extends the node.js event emitter\n */\n\nvar Mouse = structr(EventEmitter, {  \n\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._super();\n\n\t\t//initial coords\n\t\tthis.move(0, 0);\n\t},\n\n\t/**\n\t * moves the mouse\n\t */\n\n\t\"move\": function(x, y) {\n\t\tthis.position({ x: x, y: y});\n\t},\n\n\t/**\n\t * second version of move incase an object is provided\n\t */\n\n\t\"second move\": function(position) {\n\t\tthis.position(position);\n\t},\n\n\t/**\n\t * getter / setter for the position\n\t */\n\n\t\"explicit position\": {\n\t\t\"get\": function() {\n\t\t\treturn this._position;\n\t\t},\n\t\t\"set\": function(value) {\n\t\t\tthis._position = value;\n\t\t\tthis.emit(\"move\");\n\t\t}\n\t} \n});                      \n\nvar mouse = new Mouse();\n\n//listen for when the mouse has moved\nmouse.on(\"move\", function() {\n\tconsole.log(\"mouse moved!\");\n})\n\n//move 100 px left, and 100 px from the top\nmouse.move(100, 100);\n\n```\n\n\n### Class.extend(target, [...mixins]);\n\nExtends a class\n\n\n```javascript\n\nvar fs  = require(\"fs\"),\nstructr = require(\"structr\"),\nmkdirp  = require(\"mkdirp\"),\npath    = require(\"path\");\n\n//mixin the singleton plugin\nstructr.mixin(require(\"asyngleton\"));\n\n/**\n * base cache interface\n */\n\nvar AbstractCache = structr({\n\t\n\t/**\n\t * returns a cached value\n\t */\n\n\t\"abstract get\": function(key, onGet) { },\n\n\t/**\n\t * sets a cached value\n\t */\n\n\t\"abstract set\": function(key, value, onSet) { }\n});\n\n/**\n * memory cache\n */\n\nvar MemoryCache = AbstractCache.extend({\n\t\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._collection = {};\n\t},\n\n\t/**\n\t */\n\n\t\"get\": function(key, onGet) {\n\t\tonGet(null, this._collection[key]);\n\t},\n\n\t/**\n\t */\n\n\t\"set\": function(key, value, onSet) {\n\t\tthis._collection[key] = value;\n\t\tif(onSet) onSet(null, value);\n\t}\n});\n\n\n/**\n */\n\nvar FsCache = MemoryCache.extend({\n\t\t\n\t/**\n\t */\n\n\t\"override __construct\": function(path) {\n\t\tthis._path = path;\n\t\tthis._super();\n\t},\n\n\t/**\n\t */\n\n\t\"override set\": function() {\n\t\tthis._super.apply(this, arguments);\n\t\tthis._save();\n\t},\n\n\t/**\n\t */\n\n\t\"override get\": function(key, onKey) {\n\t\tvar _super = this._super;\n\n\t\t//load the fs cache before getting the value - this only happens ONCE \n\t\t//since _load is an asynchronous singleton.\n\t\tthis._load(function() {\n\t\t\t_super(key, onKey);\n\t\t});\n\t},\n\n\n\t/**\n\t * saves the collection to disc\n\t */\n\n\t\"_save\": function() {\n\t\tif(this._saving) return;\n\t\tthis._saving = true;\n\n\t\tvar self = this;\n\n\t\t//make the directory incase it doesn't exist. \n\t\tthis._mkdir(path.dirname(this._path), function() {\n\n\t\t\t//write the json file, with the json content\n\t\t\tfs.writeFile(self._path, JSON.parse(self._collection), function(err result) {\n\n\t\t\t\t//give some time before unlocking the save method. \n\t\t\t\t//We don't want to hit fs.write on each set\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself._saving = false;\n\t\t\t\t}, 2000);\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * loads the fs cache into memory\n\t */\n\n\t\"singleton _load\": function(onLoad) {\n\t\ttry {\n\t\t\tthis._collection = require(this._path);\n\t\t} catch(e) {\n\t\t\t//do nothing - the file doesn't exist\n\t\t}\n\t\tonLoad();\n\t},\n\n\t/**\n\t * makes the fs cache directory incase it's nested. Only happens ONCE on save.\n\t */\n\n\t\"singleton _mkdir\": function(onMkdir) {\n\t\tmkdirp(path.dirname(this._path), onMkdir);\n\t}\n});\n\n\nvar cache = new FsCache(__dirname + \"/test.json\");\n\n\ncache.get(\"name\", function(err, name) {\n\n\tif(name) {\n\t\treturn console.log(\"hello %s!\", name);\n\t}\n\n\tcache.set(\"name\", \"craig\", function() {\n\t\tconsole.log(\"saved!\");\n\t});\n});\n\n```\n\n### Modifiers    \n                      \n### Overriding Methods\n\nMethods overridden have access to the _super property.\n\n```javascript\n\n\"override __construct\": function ()\n{\n\tthis._super();\n}\n\n```\n\n### Overwriting Methods\n   \nFaster if you don't plan on using _super.\n\n\n```javascript\n\n\"__construct\": function ()\n{\n\t//cannot access _super __construct\n}\n\n```\n\t\n\t\n### Overloading Methods (Experimental)\n\nOverloading methods allows you to write methods which are mapped out depending on the number of parameters used. You must provide your own identifier (it could be anything) for each overloaded method, otherwise you'll simply be overwriting methods. For this example, I separate methods based on their order, e.g. `one`, `two`, `three`, etc.\n\n\n```javascript\n\nvar Person = Structr({\n\n\t\"sayHello\": function (name, callback)\n\t{\n\t\tthis._name = name;\n\t\tthis.sayHello(callback);\n\t},\n\n\t\"second sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello());\n\t},\n\n\t\"third sayHello\": function ()\n\t{\n\t\treturn 'Hello ' + this._name;\n\t}\n});\n\nvar SubPerson = Person.extend({\n\n\t\"override sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello() + \" Do you like italian food?\");\n\t},\n\n\t\"override second sayHello\": function ()\n\t{\n\t\treturn \"Hello \" + this._name + \", how are you doing today?\";\n\t}\n});\n\n\nvar p = new SubPerson();\np.sayHello(\"Craig\", function(message)\n{\n\talert(message); //Hello Craig. how are you doing today? Do you like italian food?\n});\n\n```\n\n### Static Keyword \n\nProperties, and methods set to the class versus objects instantiated.\n\n\n```javascript\n\nvar Singleton = Structr({\n\t\n\t\"static getInstance\": function ()\n\t{\n\t\treturn this._instance || (this._instance = new Singleton());\n\t}\n});\n\nvar test1 = Singleton.getInstance();\nvar test2 = Singleton.getInstance();\ntest2.name = 'Craig';\n\nconsole.log(test1.name); //Craig\n\n```\n\n### Getters & Setters   \n\nBoth Implicit / Explicit methods are supported, however implicit getters & setters aren't supported in all browsers. Use implicit get/set if you're doing any development under a specific platform such as Node.js, or Appcelerator Titanium.\n\n\n\n```javascript\n\nvar GSTestClass = Structr({\n\n\t\"explicit explicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"implicit implicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"explicit explicitValue2\":true\n});\n\n\nvar test = new GSTestClass();\ntest.explicitValue('Craig'); \nconsole.log(test.explicitValue());\n\ntest.implicitValue = 'Tim';\nconsole.log(test.implicitValue);//Tim\nconsole.log(test.explicitValue());//Tim\n\ntest.explicitValue2('hello world');\nconsole.log(test.explicitValue2());//hello world\n\t\n```\n\nMetadata \n--------\n\nCustom modifiers are considered metadata. Use them to identify how specific methods should be handled.\n\n\n```javascript\n\n\nvar MetadataTestClass = Structr({\n\t\n\t\"myCustomMetadata test\": function ()\n\t{\n\t\treturn \"Hello Test\";\n\t}\n}));\n\n\nconsole.log(MetadataTestClass.prototype.test.myCustomMetadata); //true\n\n```\n\t\n\t\n###Bindable Metadata\n\nTo add. Makes a property bindable for change. Psuedocode:\n\n\n```javascript\n\nvar Person = Structr({\n\t\n\t\"__construct\": function(name)\n\t{\n\t\tthis.name(name);\n\t\t\n\t\tBindable.apply(this);\n\t},\n\t\n\t\"bindable explicit name\": 1\n});\n\n\nvar person1 = new Person(\"craig\");\n\n//listen for any change to name\nperson1.name.subscribe(function(newName)\n{\n\talert('Name changed to '+newName);\n});\n\n//on change the subscribers will be triggered\nperson1.name(\"Craig\");\n\n```\n\t\n###Setting Metadata\n\nTo add. Easy way to store settings on the user's computer. Psuedocode:\n\n\n```javascript\n\nvar User = Structr({\n\n\t\"__construct\": function ()\n\t{\n\t\tSettingManager.apply(this);\n\t},\n\t\n\t\"login\": function ()\n\t{\n\t\t\n\t\t//set the account info which will be saved as a cookie\n\t\tthis.accountInfo({ name: \"Craig\", last: \"Condon\", token: \"XXXXXXXXXX\" })\n\t},\n\t\n\t\"setting explicit accountInfo\": 1\n});\n\n\nvar u = new User();\n\n//this gets passed once\nif(!u.accountInfo)\n{\n\tu.login();\n}\nelse\n{\n\t//pulled from local computer\n\talert(u.accountInfo.name);\n}\n\n```\n\t\n\t\nTips:\n----\n\n* Use underscores before any private method / property. \n\nE.g: \n\n\n```javascript\n\nvar SomeClass = Structr({\n\t\n\t\"__construct\": function ()\n\t{\n\t\tthis._myPrivateVariable = \"some private value\";\n\t},\n\t\n\t\"_myPrivateMethod\": function ()\n\t{\n\t\t//private stuff here\n\t}\n});\n\n```\n\t\n* Wrap methods / properties in single, or double quotes. \n* Avoid the over-use of override, or overloaded methods.\n* Only use Structr where you would create prototyped classes.\n\n\nTo Do:\n------\n\n- change _super(...) to _super({ method: [args]  }), or _super('method').call(...);\n\n\t\n\n\n","readmeFilename":"README.md","_id":"structr@0.2.2","dist":{"shasum":"e1271931170b189711e12a08cd90fd5d5feee652","tarball":"https://registry.npmjs.org/structr/-/structr-0.2.2.tgz","integrity":"sha512-mdvkQQaNQEsJVcvndH5IVueT+JtlJ6TnZrgnG9DhGDUuHBxHAnE9w2XErHA2FMTRRaeExj+bjWy4Uja3w552GQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQ8I0YOiCNJAnMszdMVUskr10XUQTJMZBbR175At14VAiEArIaSHKW6XWkk5+891Oguryyy2sW4tM9H6qSsQLXg9UE="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.2.3":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.2.3","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","readme":"Structr -  Structure for Javascript            \n======================================== \n\nStructr is a framework with the following goals:\n                                               \n* Lightweight.\n# Fast.\n* Provide as few new concepts as possible coming from OOP.\n* Easy to learn.\n* Help develop re-useable, clean, and consistent code.              \n* Reduce the amount of reduntant/boilerplate code.  \n\n\n### Supported Operators:        \n                                             \n* _super                                     \n* inheritance      \n* overloading methods\n* Implicit / Explicit getters & setters\n* Override, and Static  \n* abstract methods\n* add your own custom operators (mixins)\n\n\n### Third-party mixins\n\n* [asyngleton](/crcn/asyngleton.js) - asynchronous singletons\n* [step](/crcn/structr-step) \n                           \n\n\n### Installation\n\nNode.js: \n\n\tnpm install structr\n\t\t   \n\t\t\n### .structr([...parents], classObject)\n\n\n```javascript\n\nvar EventEmitter = require(\"events\").EventEmitter,\nstructr          = require(\"structr\");\n \n/**\n * create a mouse class which extends the node.js event emitter\n */\n\nvar Mouse = structr(EventEmitter, {  \n\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._super();\n\n\t\t//initial coords\n\t\tthis.move(0, 0);\n\t},\n\n\t/**\n\t * moves the mouse\n\t */\n\n\t\"move\": function(x, y) {\n\t\tthis.position({ x: x, y: y});\n\t},\n\n\t/**\n\t * second version of move incase an object is provided\n\t */\n\n\t\"second move\": function(position) {\n\t\tthis.position(position);\n\t},\n\n\t/**\n\t * getter / setter for the position\n\t */\n\n\t\"explicit position\": {\n\t\t\"get\": function() {\n\t\t\treturn this._position;\n\t\t},\n\t\t\"set\": function(value) {\n\t\t\tthis._position = value;\n\t\t\tthis.emit(\"move\");\n\t\t}\n\t} \n});                      \n\nvar mouse = new Mouse();\n\n//listen for when the mouse has moved\nmouse.on(\"move\", function() {\n\tconsole.log(\"mouse moved!\");\n})\n\n//move 100 px left, and 100 px from the top\nmouse.move(100, 100);\n\n```\n\n\n### Class.extend(target, [...mixins]);\n\nExtends a class\n\n\n```javascript\n\nvar fs  = require(\"fs\"),\nstructr = require(\"structr\"),\nmkdirp  = require(\"mkdirp\"),\npath    = require(\"path\");\n\n//mixin the singleton plugin\nstructr.mixin(require(\"asyngleton\"));\n\n/**\n * base cache interface\n */\n\nvar AbstractCache = structr({\n\t\n\t/**\n\t * returns a cached value\n\t */\n\n\t\"abstract get\": function(key, onGet) { },\n\n\t/**\n\t * sets a cached value\n\t */\n\n\t\"abstract set\": function(key, value, onSet) { }\n});\n\n/**\n * memory cache\n */\n\nvar MemoryCache = AbstractCache.extend({\n\t\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._collection = {};\n\t},\n\n\t/**\n\t */\n\n\t\"get\": function(key, onGet) {\n\t\tonGet(null, this._collection[key]);\n\t},\n\n\t/**\n\t */\n\n\t\"set\": function(key, value, onSet) {\n\t\tthis._collection[key] = value;\n\t\tif(onSet) onSet(null, value);\n\t}\n});\n\n\n/**\n */\n\nvar FsCache = MemoryCache.extend({\n\t\t\n\t/**\n\t */\n\n\t\"override __construct\": function(path) {\n\t\tthis._path = path;\n\t\tthis._super();\n\t},\n\n\t/**\n\t */\n\n\t\"override set\": function() {\n\t\tthis._super.apply(this, arguments);\n\t\tthis._save();\n\t},\n\n\t/**\n\t */\n\n\t\"override get\": function(key, onKey) {\n\t\tvar _super = this._super;\n\n\t\t//load the fs cache before getting the value - this only happens ONCE \n\t\t//since _load is an asynchronous singleton.\n\t\tthis._load(function() {\n\t\t\t_super(key, onKey);\n\t\t});\n\t},\n\n\n\t/**\n\t * saves the collection to disc\n\t */\n\n\t\"_save\": function() {\n\t\tif(this._saving) return;\n\t\tthis._saving = true;\n\n\t\tvar self = this;\n\n\t\t//make the directory incase it doesn't exist. \n\t\tthis._mkdir(path.dirname(this._path), function() {\n\n\t\t\t//write the json file, with the json content\n\t\t\tfs.writeFile(self._path, JSON.parse(self._collection), function(err result) {\n\n\t\t\t\t//give some time before unlocking the save method. \n\t\t\t\t//We don't want to hit fs.write on each set\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself._saving = false;\n\t\t\t\t}, 2000);\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * loads the fs cache into memory\n\t */\n\n\t\"singleton _load\": function(onLoad) {\n\t\ttry {\n\t\t\tthis._collection = require(this._path);\n\t\t} catch(e) {\n\t\t\t//do nothing - the file doesn't exist\n\t\t}\n\t\tonLoad();\n\t},\n\n\t/**\n\t * makes the fs cache directory incase it's nested. Only happens ONCE on save.\n\t */\n\n\t\"singleton _mkdir\": function(onMkdir) {\n\t\tmkdirp(path.dirname(this._path), onMkdir);\n\t}\n});\n\n\nvar cache = new FsCache(__dirname + \"/test.json\");\n\n\ncache.get(\"name\", function(err, name) {\n\n\tif(name) {\n\t\treturn console.log(\"hello %s!\", name);\n\t}\n\n\tcache.set(\"name\", \"craig\", function() {\n\t\tconsole.log(\"saved!\");\n\t});\n});\n\n```\n\n### Modifiers    \n                      \n### Overriding Methods\n\nMethods overridden have access to the _super property.\n\n```javascript\n\n\"override __construct\": function ()\n{\n\tthis._super();\n}\n\n```\n\n### Overwriting Methods\n   \nFaster if you don't plan on using _super.\n\n\n```javascript\n\n\"__construct\": function ()\n{\n\t//cannot access _super __construct\n}\n\n```\n\t\n\t\n### Overloading Methods (Experimental)\n\nOverloading methods allows you to write methods which are mapped out depending on the number of parameters used. You must provide your own identifier (it could be anything) for each overloaded method, otherwise you'll simply be overwriting methods. For this example, I separate methods based on their order, e.g. `one`, `two`, `three`, etc.\n\n\n```javascript\n\nvar Person = Structr({\n\n\t\"sayHello\": function (name, callback)\n\t{\n\t\tthis._name = name;\n\t\tthis.sayHello(callback);\n\t},\n\n\t\"second sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello());\n\t},\n\n\t\"third sayHello\": function ()\n\t{\n\t\treturn 'Hello ' + this._name;\n\t}\n});\n\nvar SubPerson = Person.extend({\n\n\t\"override sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello() + \" Do you like italian food?\");\n\t},\n\n\t\"override second sayHello\": function ()\n\t{\n\t\treturn \"Hello \" + this._name + \", how are you doing today?\";\n\t}\n});\n\n\nvar p = new SubPerson();\np.sayHello(\"Craig\", function(message)\n{\n\talert(message); //Hello Craig. how are you doing today? Do you like italian food?\n});\n\n```\n\n### Static Keyword \n\nProperties, and methods set to the class versus objects instantiated.\n\n\n```javascript\n\nvar Singleton = Structr({\n\t\n\t\"static getInstance\": function ()\n\t{\n\t\treturn this._instance || (this._instance = new Singleton());\n\t}\n});\n\nvar test1 = Singleton.getInstance();\nvar test2 = Singleton.getInstance();\ntest2.name = 'Craig';\n\nconsole.log(test1.name); //Craig\n\n```\n\n### Getters & Setters   \n\nBoth Implicit / Explicit methods are supported, however implicit getters & setters aren't supported in all browsers. Use implicit get/set if you're doing any development under a specific platform such as Node.js, or Appcelerator Titanium.\n\n\n\n```javascript\n\nvar GSTestClass = Structr({\n\n\t\"explicit explicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"implicit implicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"explicit explicitValue2\":true\n});\n\n\nvar test = new GSTestClass();\ntest.explicitValue('Craig'); \nconsole.log(test.explicitValue());\n\ntest.implicitValue = 'Tim';\nconsole.log(test.implicitValue);//Tim\nconsole.log(test.explicitValue());//Tim\n\ntest.explicitValue2('hello world');\nconsole.log(test.explicitValue2());//hello world\n\t\n```\n\nMetadata \n--------\n\nCustom modifiers are considered metadata. Use them to identify how specific methods should be handled.\n\n\n```javascript\n\n\nvar MetadataTestClass = Structr({\n\t\n\t\"myCustomMetadata test\": function ()\n\t{\n\t\treturn \"Hello Test\";\n\t}\n}));\n\n\nconsole.log(MetadataTestClass.prototype.test.myCustomMetadata); //true\n\n```\n\t\n\t\n###Bindable Metadata\n\nTo add. Makes a property bindable for change. Psuedocode:\n\n\n```javascript\n\nvar Person = Structr({\n\t\n\t\"__construct\": function(name)\n\t{\n\t\tthis.name(name);\n\t\t\n\t\tBindable.apply(this);\n\t},\n\t\n\t\"bindable explicit name\": 1\n});\n\n\nvar person1 = new Person(\"craig\");\n\n//listen for any change to name\nperson1.name.subscribe(function(newName)\n{\n\talert('Name changed to '+newName);\n});\n\n//on change the subscribers will be triggered\nperson1.name(\"Craig\");\n\n```\n\t\n###Setting Metadata\n\nTo add. Easy way to store settings on the user's computer. Psuedocode:\n\n\n```javascript\n\nvar User = Structr({\n\n\t\"__construct\": function ()\n\t{\n\t\tSettingManager.apply(this);\n\t},\n\t\n\t\"login\": function ()\n\t{\n\t\t\n\t\t//set the account info which will be saved as a cookie\n\t\tthis.accountInfo({ name: \"Craig\", last: \"Condon\", token: \"XXXXXXXXXX\" })\n\t},\n\t\n\t\"setting explicit accountInfo\": 1\n});\n\n\nvar u = new User();\n\n//this gets passed once\nif(!u.accountInfo)\n{\n\tu.login();\n}\nelse\n{\n\t//pulled from local computer\n\talert(u.accountInfo.name);\n}\n\n```\n\t\n\t\nTips:\n----\n\n\t\n* Wrap methods / properties in single, or double quotes. \n* Avoid the over-use of override, or overloaded methods.\n* Only use Structr where you would create prototyped classes.\n\n\nTo Do:\n------\n\n- change _super(...) to _super({ method: [args]  }), or _super('method').call(...);\n\n\t\n\n\n","readmeFilename":"README.md","_id":"structr@0.2.3","dist":{"shasum":"b6b02a0eb7f19e767e01b0ff890a98dda23aec0e","tarball":"https://registry.npmjs.org/structr/-/structr-0.2.3.tgz","integrity":"sha512-vLiDfAgUKXOBKsrhCMKUqMBiemtFPMfhggGeZmNVdk2KI6p9BNgW8Z2dBnYs72iPRmIBCulVyXEbY3DcMn0fWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBs71JxvOVD/tojzD7oNlGC++2vgqmi2rbaZs4VsIMRSAiEA/h9Yv88F6T4YbXMVM5wD/BF+GvwxI0vXvfnyc7ICel0="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.2.4":{"name":"structr","description":"Clean OO structure for Javascript.","version":"0.2.4","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","readme":"Structr -  Structure for Javascript            \n======================================== \n\nStructr is a framework with the following goals:\n                                               \n* Lightweight.\n# Fast.\n* Provide as few new concepts as possible coming from OOP.\n* Easy to learn.\n* Help develop re-useable, clean, and consistent code.              \n* Reduce the amount of reduntant/boilerplate code.  \n\n\n### Supported Operators:        \n                                             \n* _super                                     \n* inheritance      \n* overloading methods\n* Implicit / Explicit getters & setters\n* Override, and Static  \n* abstract methods\n* add your own custom operators (mixins)\n\n\n### Third-party mixins\n\n* [asyngleton](/crcn/asyngleton.js) - asynchronous singletons\n* [step](/crcn/structr-step) \n                           \n\n\n### Installation\n\nNode.js: \n\n\tnpm install structr\n\t\t   \n\t\t\n### .structr([...parents], classObject)\n\n\n```javascript\n\nvar EventEmitter = require(\"events\").EventEmitter,\nstructr          = require(\"structr\");\n \n/**\n * create a mouse class which extends the node.js event emitter\n */\n\nvar Mouse = structr(EventEmitter, {  \n\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._super();\n\n\t\t//initial coords\n\t\tthis.move(0, 0);\n\t},\n\n\t/**\n\t * moves the mouse\n\t */\n\n\t\"move\": function(x, y) {\n\t\tthis.position({ x: x, y: y});\n\t},\n\n\t/**\n\t * second version of move incase an object is provided\n\t */\n\n\t\"second move\": function(position) {\n\t\tthis.position(position);\n\t},\n\n\t/**\n\t * getter / setter for the position\n\t */\n\n\t\"explicit position\": {\n\t\t\"get\": function() {\n\t\t\treturn this._position;\n\t\t},\n\t\t\"set\": function(value) {\n\t\t\tthis._position = value;\n\t\t\tthis.emit(\"move\");\n\t\t}\n\t} \n});                      \n\nvar mouse = new Mouse();\n\n//listen for when the mouse has moved\nmouse.on(\"move\", function() {\n\tconsole.log(\"mouse moved!\");\n})\n\n//move 100 px left, and 100 px from the top\nmouse.move(100, 100);\n\n```\n\n\n### Class.extend(target, [...mixins]);\n\nExtends a class\n\n\n```javascript\n\nvar fs  = require(\"fs\"),\nstructr = require(\"structr\"),\nmkdirp  = require(\"mkdirp\"),\npath    = require(\"path\");\n\n//mixin the singleton plugin\nstructr.mixin(require(\"asyngleton\"));\n\n/**\n * base cache interface\n */\n\nvar AbstractCache = structr({\n\t\n\t/**\n\t * returns a cached value\n\t */\n\n\t\"abstract get\": function(key, onGet) { },\n\n\t/**\n\t * sets a cached value\n\t */\n\n\t\"abstract set\": function(key, value, onSet) { }\n});\n\n/**\n * memory cache\n */\n\nvar MemoryCache = AbstractCache.extend({\n\t\n\t/**\n\t */\n\n\t\"__construct\": function() {\n\t\tthis._collection = {};\n\t},\n\n\t/**\n\t */\n\n\t\"get\": function(key, onGet) {\n\t\tonGet(null, this._collection[key]);\n\t},\n\n\t/**\n\t */\n\n\t\"set\": function(key, value, onSet) {\n\t\tthis._collection[key] = value;\n\t\tif(onSet) onSet(null, value);\n\t}\n});\n\n\n/**\n */\n\nvar FsCache = MemoryCache.extend({\n\t\t\n\t/**\n\t */\n\n\t\"override __construct\": function(path) {\n\t\tthis._path = path;\n\t\tthis._super();\n\t},\n\n\t/**\n\t */\n\n\t\"override set\": function() {\n\t\tthis._super.apply(this, arguments);\n\t\tthis._save();\n\t},\n\n\t/**\n\t */\n\n\t\"override get\": function(key, onKey) {\n\t\tvar _super = this._super;\n\n\t\t//load the fs cache before getting the value - this only happens ONCE \n\t\t//since _load is an asynchronous singleton.\n\t\tthis._load(function() {\n\t\t\t_super(key, onKey);\n\t\t});\n\t},\n\n\n\t/**\n\t * saves the collection to disc\n\t */\n\n\t\"_save\": function() {\n\t\tif(this._saving) return;\n\t\tthis._saving = true;\n\n\t\tvar self = this;\n\n\t\t//make the directory incase it doesn't exist. \n\t\tthis._mkdir(path.dirname(this._path), function() {\n\n\t\t\t//write the json file, with the json content\n\t\t\tfs.writeFile(self._path, JSON.parse(self._collection), function(err result) {\n\n\t\t\t\t//give some time before unlocking the save method. \n\t\t\t\t//We don't want to hit fs.write on each set\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself._saving = false;\n\t\t\t\t}, 2000);\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * loads the fs cache into memory\n\t */\n\n\t\"singleton _load\": function(onLoad) {\n\t\ttry {\n\t\t\tthis._collection = require(this._path);\n\t\t} catch(e) {\n\t\t\t//do nothing - the file doesn't exist\n\t\t}\n\t\tonLoad();\n\t},\n\n\t/**\n\t * makes the fs cache directory incase it's nested. Only happens ONCE on save.\n\t */\n\n\t\"singleton _mkdir\": function(onMkdir) {\n\t\tmkdirp(path.dirname(this._path), onMkdir);\n\t}\n});\n\n\nvar cache = new FsCache(__dirname + \"/test.json\");\n\n\ncache.get(\"name\", function(err, name) {\n\n\tif(name) {\n\t\treturn console.log(\"hello %s!\", name);\n\t}\n\n\tcache.set(\"name\", \"craig\", function() {\n\t\tconsole.log(\"saved!\");\n\t});\n});\n\n```\n\n### Modifiers    \n                      \n### Overriding Methods\n\nMethods overridden have access to the _super property.\n\n```javascript\n\n\"override __construct\": function ()\n{\n\tthis._super();\n}\n\n```\n\n### Overwriting Methods\n   \nFaster if you don't plan on using _super.\n\n\n```javascript\n\n\"__construct\": function ()\n{\n\t//cannot access _super __construct\n}\n\n```\n\t\n\t\n### Overloading Methods (Experimental)\n\nOverloading methods allows you to write methods which are mapped out depending on the number of parameters used. You must provide your own identifier (it could be anything) for each overloaded method, otherwise you'll simply be overwriting methods. For this example, I separate methods based on their order, e.g. `one`, `two`, `three`, etc.\n\n\n```javascript\n\nvar Person = Structr({\n\n\t\"sayHello\": function (name, callback)\n\t{\n\t\tthis._name = name;\n\t\tthis.sayHello(callback);\n\t},\n\n\t\"second sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello());\n\t},\n\n\t\"third sayHello\": function ()\n\t{\n\t\treturn 'Hello ' + this._name;\n\t}\n});\n\nvar SubPerson = Person.extend({\n\n\t\"override sayHello\": function (callback)\n\t{\n\t\tcallback(this.sayHello() + \" Do you like italian food?\");\n\t},\n\n\t\"override second sayHello\": function ()\n\t{\n\t\treturn \"Hello \" + this._name + \", how are you doing today?\";\n\t}\n});\n\n\nvar p = new SubPerson();\np.sayHello(\"Craig\", function(message)\n{\n\talert(message); //Hello Craig. how are you doing today? Do you like italian food?\n});\n\n```\n\n### Static Keyword \n\nProperties, and methods set to the class versus objects instantiated.\n\n\n```javascript\n\nvar Singleton = Structr({\n\t\n\t\"static getInstance\": function ()\n\t{\n\t\treturn this._instance || (this._instance = new Singleton());\n\t}\n});\n\nvar test1 = Singleton.getInstance();\nvar test2 = Singleton.getInstance();\ntest2.name = 'Craig';\n\nconsole.log(test1.name); //Craig\n\n```\n\n### Getters & Setters   \n\nBoth Implicit / Explicit methods are supported, however implicit getters & setters aren't supported in all browsers. Use implicit get/set if you're doing any development under a specific platform such as Node.js, or Appcelerator Titanium.\n\n\n\n```javascript\n\nvar GSTestClass = Structr({\n\n\t\"explicit explicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"implicit implicitValue\": {\n\t\t\"get\": function ()\n\t\t{\n\t\t\treturn this._name;\n\t\t},\n\t\t\"set\": function (value)\n\t\t{\n\t\t\tthis._name = value;\n\t\t}\n\t},\n\t\n\t\"explicit explicitValue2\":true\n});\n\n\nvar test = new GSTestClass();\ntest.explicitValue('Craig'); \nconsole.log(test.explicitValue());\n\ntest.implicitValue = 'Tim';\nconsole.log(test.implicitValue);//Tim\nconsole.log(test.explicitValue());//Tim\n\ntest.explicitValue2('hello world');\nconsole.log(test.explicitValue2());//hello world\n\t\n```\n\nMetadata \n--------\n\nCustom modifiers are considered metadata. Use them to identify how specific methods should be handled.\n\n\n```javascript\n\n\nvar MetadataTestClass = Structr({\n\t\n\t\"myCustomMetadata test\": function ()\n\t{\n\t\treturn \"Hello Test\";\n\t}\n}));\n\n\nconsole.log(MetadataTestClass.prototype.test.myCustomMetadata); //true\n\n```\n\t\n\t\n###Bindable Metadata\n\nTo add. Makes a property bindable for change. Psuedocode:\n\n\n```javascript\n\nvar Person = Structr({\n\t\n\t\"__construct\": function(name)\n\t{\n\t\tthis.name(name);\n\t\t\n\t\tBindable.apply(this);\n\t},\n\t\n\t\"bindable explicit name\": 1\n});\n\n\nvar person1 = new Person(\"craig\");\n\n//listen for any change to name\nperson1.name.subscribe(function(newName)\n{\n\talert('Name changed to '+newName);\n});\n\n//on change the subscribers will be triggered\nperson1.name(\"Craig\");\n\n```\n\t\n###Setting Metadata\n\nTo add. Easy way to store settings on the user's computer. Psuedocode:\n\n\n```javascript\n\nvar User = Structr({\n\n\t\"__construct\": function ()\n\t{\n\t\tSettingManager.apply(this);\n\t},\n\t\n\t\"login\": function ()\n\t{\n\t\t\n\t\t//set the account info which will be saved as a cookie\n\t\tthis.accountInfo({ name: \"Craig\", last: \"Condon\", token: \"XXXXXXXXXX\" })\n\t},\n\t\n\t\"setting explicit accountInfo\": 1\n});\n\n\nvar u = new User();\n\n//this gets passed once\nif(!u.accountInfo)\n{\n\tu.login();\n}\nelse\n{\n\t//pulled from local computer\n\talert(u.accountInfo.name);\n}\n\n```\n\t\n\t\nTips:\n----\n\n\t\n* Wrap methods / properties in single, or double quotes. \n* Avoid the over-use of override, or overloaded methods.\n* Only use Structr where you would create prototyped classes.\n\n\nTo Do:\n------\n\n- change _super(...) to _super({ method: [args]  }), or _super('method').call(...);\n\n\t\n\n\n","readmeFilename":"README.md","_id":"structr@0.2.4","dist":{"shasum":"8a15aab501bc59333fb1d529721be89f1bc3dc93","tarball":"https://registry.npmjs.org/structr/-/structr-0.2.4.tgz","integrity":"sha512-hL77hWtJhhuhDb4od5ywwAnVUlq9Krzk4BCoWhfiPtTEHvqBqRUm6lJ5PQlCrMWyi8Cv4+AXA/Mu6dbeTN/fGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcxTRQecRzypW1bja26GOAIZnMZd3p0KSdY9rOoZ7EWwIhALzgDbWH5JG1MRP29gfv9nsHoGW2AjekcZJuxFfBImzi"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.3.0":{"name":"structr","description":"javascript class system","version":"0.3.0","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","devDependencies":{"expect":"0.0.2","mocha":"~1.13.0"},"readme":"Structr is a thin class library that helps create, and extend prototypes.\n\n## Example\n\n\n```javascript\nvar Animal = structr({\n\tconstruct: function(name) {\n\t\tthis.name = name;\n\t}\n});\n\nvar Cat = Animal.extend({\n\tmeow: function() {\n\t\tconsole.log(this.name + \": meow!\");\n\t}\n});\n\nvar cat = new Cat(\"sam\");\ncat.meow(); // sam: meow!\n```","readmeFilename":"README.md","_id":"structr@0.3.0","dist":{"shasum":"9bc26a29ffd23a9d251f2f79792a627461dd5f6b","tarball":"https://registry.npmjs.org/structr/-/structr-0.3.0.tgz","integrity":"sha512-WR4Hv/ULU7ggJFdxwuw4nNFFVcvU49ns7rI5fQK0+9sBot1Bux6MthwAXVI8Enr/NH4z4H7n6en2981nyY4yfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbE87X042NBQN64E5sibiDNAksbk17kl0QQeS6uAaBSwIgIovCSwMcc7FUG7aGl4q52asWpDBRf6hucsIJTmPKnNs="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.3.1":{"name":"structr","description":"javascript class system","version":"0.3.1","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","devDependencies":{"expect":"0.0.2","mocha":"~1.13.0"},"readme":"Structr is a thin class library that helps create, and extend prototypes.\n\n## Example\n\n\n```javascript\nvar Animal = structr({\n\tconstruct: function(name) {\n\t\tthis.name = name;\n\t}\n});\n\nvar Cat = Animal.extend({\n\tmeow: function() {\n\t\tconsole.log(this.name + \": meow!\");\n\t}\n});\n\nvar cat = new Cat(\"sam\");\ncat.meow(); // sam: meow!\n```","readmeFilename":"README.md","_id":"structr@0.3.1","dist":{"shasum":"d97164add1c9598f28cfec3b716c65466365d419","tarball":"https://registry.npmjs.org/structr/-/structr-0.3.1.tgz","integrity":"sha512-m9DkVGPX2zAHeI+LBzDM4Ac71uMXp0xGELrdQW2WISvww7OFW4me6KQti1XE+WQeh0hT0SZt39/pAv+FqPWWzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICkzOFNm+yHzwosSnu2/ePomVGUutJYC/hC4HVJ+bxuVAiB960ChQ5yydEGq0LgOJ5boxJZ/hJDPcJRk8WmmcTb3BA=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"directories":{}},"0.3.2":{"name":"structr","description":"javascript class system","version":"0.3.2","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"main":"./lib/index.js","devDependencies":{"expect":"0.0.2","mocha":"~1.13.0"},"readme":"Structr is a thin class library that helps create, and extend prototypes.\n\n## Example\n\n\n```javascript\n\n\nfunction Animal(name) {\n  this.name = name;\n}\n\nfunction Cat(name) {\n  Cat.__super__.apply(this, arguments);\n}\n\nstructr(Animal, Cat, {\n  meow: function() {\n    console.log(this.name + \": meow\");\n  }\n});\n\n\n```","readmeFilename":"README.md","_id":"structr@0.3.2","dist":{"shasum":"21a800daf280b16ad745caf4f9c8a23d3771ae0f","tarball":"https://registry.npmjs.org/structr/-/structr-0.3.2.tgz","integrity":"sha512-PQXtNGxNrl6ZYjlSoIixfNveac9Gnb9XJRsJ163vWh8qc5Q9R0YSIq3Yf4VT7xjxZb/1dtuwNf7+axm9cjayLw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDO4HwforT41Q2Hiw9nbp4YJInu4X9pi8qwlbG9qZ+MBwIgO93anaZ9FZW/73I6rkQvS/APwkH81wJqci6diZQzg3o="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}]}},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"}],"time":{"modified":"2022-06-27T01:20:46.069Z","created":"2011-07-01T00:40:56.296Z","0.0.1":"2011-07-01T00:40:56.503Z","0.0.2":"2011-07-01T01:07:15.230Z","0.0.3":"2011-07-03T23:11:36.983Z","0.0.4":"2011-07-12T02:34:07.171Z","0.0.4-1":"2011-07-13T04:26:37.280Z","0.0.4-2":"2011-07-21T21:22:51.114Z","0.0.4-3":"2011-07-28T05:41:32.294Z","0.0.5":"2011-08-01T19:33:18.840Z","0.0.8":"2011-08-10T02:59:04.719Z","0.0.10":"2011-09-12T05:22:06.476Z","0.1.0":"2011-12-03T23:18:05.086Z","0.1.3":"2012-01-29T00:52:33.054Z","0.2.0":"2012-04-27T21:23:21.857Z","0.2.2":"2012-11-02T04:00:59.091Z","0.2.3":"2013-03-14T23:44:05.057Z","0.2.4":"2013-10-17T23:58:04.827Z","0.3.0":"2013-11-01T00:18:45.029Z","0.3.1":"2013-11-01T19:04:57.515Z","0.3.2":"2013-11-01T19:56:45.406Z"},"description":"javascript class system","author":{"name":"Craig Condon"},"repository":{"type":"git","url":"http://github.com/spiceapps/Structr.git"},"users":{"fgribreau":true}}