{"name":"class-extend","version":"0.1.2","description":"Backbone like Class.extend utility for Node","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/class-extend.git"},"keywords":["inheritance","oop","class","extend"],"author":{"name":"Simon Boudrias"},"license":"MIT","files":["index.js"],"dependencies":{"object-assign":"^2.0.0"},"devDependencies":{"mocha":"^2.1.0","sinon":"^1.12.2"},"gitHead":"eba63480833617b421a595324488ccceaf019fd3","bugs":{"url":"https://github.com/sboudrias/class-extend/issues"},"homepage":"https://github.com/sboudrias/class-extend#readme","_id":"class-extend@0.1.2","_shasum":"8057a82b00f53f82a5d62c50ef8cffdec6fabc34","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"8057a82b00f53f82a5d62c50ef8cffdec6fabc34","tarball":"http://registry-npm.ywwl.com/class-extend/download/class-extend-0.1.2.tgz","integrity":"sha512-qcBj0uCCmK4RAdEgpmzMS2q9+RboTBYgApUICr6dES+hahjEIMrfvZoqvpSSIPN1GPfoA4RV6B43LS7K+kYtbQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnjrzlYMtHC5ApUARYCpDsw8O8GHszstK/3nugvgvxmAiEA8EtX8+OlN/Fr0bJKUszvmOtR0G/I668rTyy/KkM5RHM="}],"size":2102,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.2.tgz"},"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":1444672066302,"_cnpm_publish_time":1444672066302,"dist-tags":{"latest":"1.0.0"}}