{"_id":"class-extend","_rev":"4642878","name":"class-extend","description":"Backbone like Class.extend utility for Node","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"sboudrias","email":""}],"time":{"modified":"2026-04-10T20:05:35.000Z","created":"2013-12-27T00:28:05.570Z","1.0.0":"2025-01-10T22:17:23.094Z","0.1.2":"2015-10-12T17:47:46.302Z","0.1.1":"2013-12-31T22:41:59.745Z","0.1.0":"2013-12-27T00:28:05.570Z"},"users":{"itonyyo":true,"ziflex":true,"serebro":true},"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/class-extend.git"},"versions":{"1.0.0":{"name":"class-extend","version":"1.0.0","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","email":"admin@simonboudrias.com"},"license":"MIT","devDependencies":{"mocha":"^11.0.1","sinon":"^19.0.2"},"gitHead":"c1a25c9f30cf7a22e59d8bfbca2bea40591b0860","bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"homepage":"https://github.com/SBoudrias/class-extend#readme","_id":"class-extend@1.0.0","_nodeVersion":"22.9.0","_npmVersion":"8.19.2","dist":{"shasum":"8cc6c7697ec924f8ee41cf3c1a7beb01fd6bc0bf","size":1492,"noattachment":false,"key":"/class-extend/-/class-extend-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/class-extend/download/class-extend-1.0.0.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/class-extend_1.0.0_1736547442937_0.9125120841915513"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-10T22:17:23.094Z","publish_time":1736547443094,"_source_registry_name":"default","_cnpm_publish_time":1736547443094},"0.1.2":{"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","size":2102,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/class-extend/download/class-extend-0.1.2.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1444672066302,"_cnpm_publish_time":1444672066302,"_hasShrinkwrap":false},"0.1.1":{"name":"class-extend","version":"0.1.1","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"},"readmeFilename":"README.md","_id":"class-extend@0.1.1","dist":{"shasum":"0feb1e59f4ace7bc163b509745f3282c4c7e528a","size":2906,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/class-extend/download/class-extend-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1388529719745,"_cnpm_publish_time":1388529719745,"_hasShrinkwrap":false},"0.1.0":{"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"},"readmeFilename":"README.md","_id":"class-extend@0.1.0","dist":{"shasum":"dedeb179cdaf5bb33c9834cc75440a547e7c9086","size":2871,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/class-extend/download/class-extend-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1388104085570,"_cnpm_publish_time":1388104085570,"_hasShrinkwrap":false}},"readme":"Class.extend\n============\n\nBackbone like `.extend` inheritance helper for Node.js\n\nUsage\n------------\n\nYou basically got two options:\n\n``` javascript\n// 1. Extend from the blank class\nconst Base = require('class-extend');\nconst 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\nconst Sub = Parent.extend({\n  // Overwrite the default constructor\n  constructor() {},\n\n  // Sub class prototypes methods\n  hello() { console.log('hello'); }\n}, {\n  // Constructor static methods\n  hey() { console.log('hey'); }\n});\n\nSub.hey();\n// LOG: hey\n\nconst 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\nconst Sub = Parent.extend();\nassert(Sub.__super__ === Parent.prototype);\n```\n\nLicense\n---------------\n\nCopyright (c) 2025 Simon Boudrias  \nLicensed under the MIT license.\n","_attachments":{},"homepage":"https://github.com/SBoudrias/class-extend#readme","bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"license":"MIT"}