{"_id":"class-extend","_rev":"11-2be0ab1fe14617d898f79ca6ac6095ea","name":"class-extend","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"class-extend","version":"0.1.0","keywords":["inheritance","oop","class","extend"],"author":{"name":"Simon Boudrias"},"license":"MIT","_id":"class-extend@0.1.0","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"homepage":"https://github.com/SBoudrias/class-extend","bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"dist":{"shasum":"dedeb179cdaf5bb33c9834cc75440a547e7c9086","tarball":"https://registry.npmjs.org/class-extend/-/class-extend-0.1.0.tgz","integrity":"sha512-uXEInmT84ef/HSBrx9OzIglAWvyZqKotB5O75MA9h6MJFVkjLQaeBSxzNsz3dIcy0h2iq7LkSRuI6N9hXcYwKA==","signatures":[{"sig":"MEUCIQCm1AnLUDdS8WcdtbTlJdu+Bx6CQw2GJLfUGLzzmSBiBAIgEvhm0rx+ngwpJSEtdUHfe8J2mJo1Gx+Cv6PrnztqKT0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","scripts":{"test":"mocha"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"git://github.com/SBoudrias/class-extend.git","type":"git"},"_npmVersion":"1.3.21","description":"Backbone like Class.extend utility for Node","directories":{},"dependencies":{"lodash":"~2.4.1"},"devDependencies":{"sinon":"~1.7.3"}},"0.1.1":{"name":"class-extend","version":"0.1.1","keywords":["inheritance","oop","class","extend"],"author":{"name":"Simon Boudrias"},"license":"MIT","_id":"class-extend@0.1.1","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"homepage":"https://github.com/SBoudrias/class-extend","bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"dist":{"shasum":"0feb1e59f4ace7bc163b509745f3282c4c7e528a","tarball":"https://registry.npmjs.org/class-extend/-/class-extend-0.1.1.tgz","integrity":"sha512-mRfadHgSSEka4fWPovtcJdpHHFSULDWFuo9kdh6rSXHdGRU0HP6EgYAOH7niO/HRow0o4LEhHwSOj9J2qdPc3w==","signatures":[{"sig":"MEQCIFmUyYebBuVLqM8SX+9SWossA6HbNE4htzirw7yohdhcAiA8FgAQv3sDuRZj+nAyXtUkRxRn5vogOqDsu0ee2AEAgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","scripts":{"test":"mocha"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"git://github.com/SBoudrias/class-extend.git","type":"git"},"_npmVersion":"1.3.21","description":"Backbone like Class.extend utility for Node","dependencies":{"lodash":"~2.4.1"},"devDependencies":{"sinon":"~1.7.3"},"directories":{}},"0.1.2":{"name":"class-extend","version":"0.1.2","keywords":["inheritance","oop","class","extend"],"author":{"name":"Simon Boudrias"},"license":"MIT","_id":"class-extend@0.1.2","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"homepage":"https://github.com/sboudrias/class-extend#readme","bugs":{"url":"https://github.com/sboudrias/class-extend/issues"},"dist":{"shasum":"8057a82b00f53f82a5d62c50ef8cffdec6fabc34","tarball":"https://registry.npmjs.org/class-extend/-/class-extend-0.1.2.tgz","integrity":"sha512-qcBj0uCCmK4RAdEgpmzMS2q9+RboTBYgApUICr6dES+hahjEIMrfvZoqvpSSIPN1GPfoA4RV6B43LS7K+kYtbQ==","signatures":[{"sig":"MEUCIGnjrzlYMtHC5ApUARYCpDsw8O8GHszstK/3nugvgvxmAiEA8EtX8+OlN/Fr0bJKUszvmOtR0G/I668rTyy/KkM5RHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"8057a82b00f53f82a5d62c50ef8cffdec6fabc34","gitHead":"eba63480833617b421a595324488ccceaf019fd3","scripts":{"test":"mocha"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"git+https://github.com/sboudrias/class-extend.git","type":"git"},"_npmVersion":"2.14.4","description":"Backbone like Class.extend utility for Node","_nodeVersion":"4.1.1","dependencies":{"object-assign":"^2.0.0"},"devDependencies":{"mocha":"^2.1.0","sinon":"^1.12.2"},"directories":{}},"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":"https://registry.npmjs.org/class-extend/-/class-extend-1.0.0.tgz","fileCount":3,"unpackedSize":3201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHcPx7iI2NBDQ7ERpqu1km6fTHdL3b+TjxfjPhoqsGVxAiBYbFUS62abVCbi+TuPF4e6aCttScZ++t96CrmJMUMdLA=="}]},"_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}},"time":{"created":"2013-12-27T00:28:05.570Z","modified":"2025-01-10T22:17:23.263Z","0.1.0":"2013-12-27T00:28:05.570Z","0.1.1":"2013-12-31T22:41:59.745Z","0.1.2":"2015-10-12T17:47:46.302Z","1.0.0":"2025-01-10T22:17:23.094Z"},"bugs":{"url":"https://github.com/SBoudrias/class-extend/issues"},"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","homepage":"https://github.com/SBoudrias/class-extend#readme","keywords":["inheritance","oop","class","extend"],"repository":{"type":"git","url":"git+https://github.com/SBoudrias/class-extend.git"},"description":"Backbone like Class.extend utility for Node","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"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","readmeFilename":"README.md","users":{"ziflex":true,"itonyyo":true,"serebro":true}}