Sha256: 8bde3227cd078b5aa4c6cee22a264f1be4d973c91125fff817ca2d5abbed51ee
Contents?: true
Size: 1.75 KB
Versions: 2
Compression:
Stored size: 1.75 KB
Contents
{ "name": "inherits", "description": "A tiny simple way to do classic inheritance in js", "version": "1.0.0", "keywords": [ "inheritance", "class", "klass", "oop", "object-oriented" ], "main": "./inherits.js", "repository": { "type": "git", "url": "https://github.com/isaacs/inherits" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/inherits/issues" }, "_id": "inherits@1.0.0", "_from": "inherits@~1.0.0" }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby-wisp-source-0.8.0 | vendor/node_modules/browserify/node_modules/inherits/package.json |
ruby-wisp-source-0.7.0 | vendor/node_modules/browserify/node_modules/inherits/package.json |