{"id":29027283,"url":"https://github.com/cahnory/node-inherits","last_synced_at":"2025-06-26T06:05:21.528Z","repository":{"id":18033123,"uuid":"21071898","full_name":"cahnory/node-inherits","owner":"cahnory","description":"Inheritance module for node.js","archived":false,"fork":false,"pushed_at":"2014-06-21T15:42:11.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T21:18:06.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cahnory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-21T15:37:37.000Z","updated_at":"2014-06-21T15:42:12.000Z","dependencies_parsed_at":"2022-08-26T10:51:49.054Z","dependency_job_id":null,"html_url":"https://github.com/cahnory/node-inherits","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cahnory/node-inherits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahnory%2Fnode-inherits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahnory%2Fnode-inherits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahnory%2Fnode-inherits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahnory%2Fnode-inherits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cahnory","download_url":"https://codeload.github.com/cahnory/node-inherits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahnory%2Fnode-inherits/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262010870,"owners_count":23244414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T06:05:21.021Z","updated_at":"2025-06-26T06:05:21.507Z","avatar_url":"https://github.com/cahnory.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#node-inherits\n\nInheritance module for node.js\n\n##Getting started\n\n```\nnpm install node-inherits\n```\n\n##Overview\n\n###Inherits\n\nTo inherit from a super constructor, call inherits with your constructor and the super one:\n\n```\nSuper       = function () {};\nConstructor = inherits(function () {}, Super);\n```\n\nAnother way to do this is to call inherits with your super constructor and use its new inherits method:\n\n```\nSuper       = inherits(function () {});\nConstructor = Super.inherits(function () {});\n```\n\nDuring inheritance, all constructor are called from the super to last inherited.\n\n```\nSuper       = inherits(function () {\n  this.name = 'Super';\n});\nConstructor = Super.inherits(function () {\n  this.name += ' \u003e Constructor';\n});\n\nobject = new Constructor();\nconsole.log(object.name); // 'Super \u003e Constructor';\n```\n\n###instanceof\n\nLike with node.js util.inherits, your constructor instances will be also instance of super constructor:\n\n```\nobject  = new Constructor();\nconsole.log(object instanceof Constructor); // true\nconsole.log(object instanceof Super);       // true\n```\n\n###prototype and constructor properties\n\nAll properties attached to the constructor and prototype are inherited, taking care of their descriptors.  \nThis means that if Super constructor declared a property with `configurable` set to `false`, it will be preserved.\n\n![](https://david-dm.org/cahnory/node-inherits.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcahnory%2Fnode-inherits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcahnory%2Fnode-inherits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcahnory%2Fnode-inherits/lists"}