-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
43 lines (43 loc) · 2.39 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
"name": "inherit",
"version": "2.0.0",
"description": "Inheritance module for node",
"homepage": "https://github.com/dfilatov/node-inherit",
"keywords": [
"inheritance",
"class",
"mixin",
"object"
],
"author": {
"name": "Dmitry Filatov",
"email": "dfilatov@yandex-team.ru"
},
"contributors": [
{
"name": "Dmitry Filatov",
"email": "dfilatov@yandex-team.ru"
},
{
"name": "Sergey Belov",
"email": "peimei@ya.ru",
"url": "http://github.com/arikon"
}
],
"repository": {
"type": "git",
"url": "http://github.com/dfilatov/node-inherit.git"
},
"dependencies": {},
"devDependencies": {
"nodeunit": "0.8.0"
},
"main": "index",
"engines": {
"node": ">= 0.4.0"
},
"readme": "Node-inherit\n============\nThis module provides some syntax sugar for \"class\" declarations, constructors, \"super\" calls and static members.\n\nInstalling\n------------\n npm install inherit\n\nUsage\n------------\n inherit([baseClass], props, [staticProps]);\n \nExample\n------------\n```javascript\nvar inherit = require('inherit');\n\n// base \"class\"\nvar A = inherit(/** @lends A.prototype */{\n __constructor : function(property) { // constructor\n this.property = property;\n },\n\n getProperty : function() {\n return this.property + ' of instanceA';\n },\n \n getType : function() {\n return 'A';\n },\n\n getStaticProperty : function() {\n return this.__self.staticMember; // access to static\n }\n}, /** @lends A */ { \n staticProperty : 'staticA',\n \n staticMethod : function() {\n return this.staticProperty;\n }\n});\n\n// inherited \"class\" from A\nvar B = inherit(A, /** @lends B.prototype */{\n getProperty : function() { // overriding\n return this.property + ' of instanceB';\n },\n \n getType : function() { // overriding + \"super\" call\n return this.__base() + 'B';\n }\n}, /** @lends B */ {\n staticMethod : function() { // static overriding + \"super\" call\n return this.__base() + ' of staticB';\n }\n});\n\nvar instanceOfB = new B('property');\n\ninstanceOfB.getProperty(); // returns 'property of instanceB'\ninstanceOfB.getType(); // returns 'AB'\nB.staticMethod(); // returns 'staticA of staticB'\n```",
"readmeFilename": "readme.md",
"_id": "inherit@2.0.0",
"_from": "inherit@"
}