{"_id":"class-extend","_rev":"1689111","name":"class-extend","description":"Backbone like Class.extend utility for Node","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"time":{"modified":"2026-11-06T05:41:22.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":{"integrity":"sha512-ZzPbGCuwQyOSj2XSU7toYyzVIhujeV9lHDDFXtWkZ09DwSz4Ot5egsIe7EHjp7gLsO9fOaCzNMFFsqxGt7518w==","shasum":"8cc6c7697ec924f8ee41cf3c1a7beb01fd6bc0bf","tarball":"http://registry-npm.ywwl.com/class-extend/download/class-extend-1.0.0.tgz","fileCount":3,"unpackedSize":3201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHcPx7iI2NBDQ7ERpqu1km6fTHdL3b+TjxfjPhoqsGVxAiBYbFUS62abVCbi+TuPF4e6aCttScZ++t96CrmJMUMdLA=="}],"size":1492,"noattachment":false,"key":"/class-extend/-/class-extend-1.0.0.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/class-extend_1.0.0_1736547442937_0.9125120841915513"},"_hasShrinkwrap":false,"publish_time":1736547443094,"_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","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":{},"publish_time":1444672066302,"_cnpm_publish_time":1444672066302},"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"},"_id":"class-extend@0.1.1","dist":{"shasum":"0feb1e59f4ace7bc163b509745f3282c4c7e528a","tarball":"http://registry-npm.ywwl.com/class-extend/download/class-extend-0.1.1.tgz","integrity":"sha512-mRfadHgSSEka4fWPovtcJdpHHFSULDWFuo9kdh6rSXHdGRU0HP6EgYAOH7niO/HRow0o4LEhHwSOj9J2qdPc3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmUyYebBuVLqM8SX+9SWossA6HbNE4htzirw7yohdhcAiA8FgAQv3sDuRZj+nAyXtUkRxRn5vogOqDsu0ee2AEAgw=="}],"size":2906,"noattachment":false,"key":"/class-extend/-/class-extend-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"directories":{},"publish_time":1388529719745,"_cnpm_publish_time":1388529719745},"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"},"_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":{},"publish_time":1388104085570,"_cnpm_publish_time":1388104085570}},"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"}