{"name":"class-extend","version":"0.1.0","description":"Backbone like Class.extend utility for Node","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/SBoudrias/class-extend.git"},"keywords":["inheritance","oop","class","extend"],"author":{"name":"Simon Boudrias"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"homepage":"https://github.com/SBoudrias/class-extend","dependencies":{"lodash":"~2.4.1"},"devDependencies":{"sinon":"~1.7.3"},"_id":"class-extend@0.1.0","dist":{"shasum":"dedeb179cdaf5bb33c9834cc75440a547e7c9086","tarball":"http://registry-npm.ywwl.com/class-extend/download/class-extend-0.1.0.tgz","integrity":"sha512-uXEInmT84ef/HSBrx9OzIglAWvyZqKotB5O75MA9h6MJFVkjLQaeBSxzNsz3dIcy0h2iq7LkSRuI6N9hXcYwKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm1AnLUDdS8WcdtbTlJdu+Bx6CQw2GJLfUGLzzmSBiBAIgEvhm0rx+ngwpJSEtdUHfe8J2mJo1Gx+Cv6PrnztqKT0="}],"size":2871,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"directories":{},"readme":"Class.extend [![Build Status](https://travis-ci.org/yeoman/generator.png?branch=master)](https://travis-ci.org/SBoudrias/class-extend)\n============\n\nBackbone's `.extend` like inheritance helper for Node.js\n\nUsage\n------------\n\nYou basically got two options:\n\n``` javascript\n// 1. Extend from the blank class\nvar Base = require('class-extend');\nvar Sub = Base.extend();\n\n// 2. Add the .extend helper to a class\nMyClass.extend = require('class-extend').extend;\n```\n\n#### `.extend()`\n\n`.extend` allow you to assign prototype and static methods.\n\nIf no `constructor` method is assigned, the parent constructor method will be called by default.\n\n``` javascript\n// Extend a class\nvar Sub = Parent.extend({\n  // Overwrite the default constructor\n  constructor: function () {},\n\n  // Sub class prototypes methods\n  hello: function () { console.log('hello'); }\n}, {\n  // Constructor static methods\n  hey: function () { console.log('hey'); }\n});\n\nSub.hey();\n// LOG: hey\n\nvar instance = new Sub();\ninstance.hello();\n// LOG: hello\n```\n\n#### `.__super__`\n\nSub classes are assigned a `__super__` static property pointing to their parent prototype.\n\n``` javascript\nvar Sub = Parent.extend();\nassert(Sub.__super__ === Parent.prototype);\n```\n\nLicense\n---------------\n\nCopyright (c) 2013 Simon Boudrias  \nLicensed under the MIT license.\n","publish_time":1388104085570,"_cnpm_publish_time":1388104085570,"dist-tags":{"latest":"1.0.0"}}