{"_id":"class4js","_rev":"227-52366c608a92824a8898bbca0aeb7b30","name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","dist-tags":{"latest":"1.10.3"},"versions":{"1.0.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.0.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object): Object\n\nor\n\n    $class(properties:Object, parent:Object): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.0.0","dist":{"shasum":"fc7da5837ac5ba82f4eb3d69139f6c2af6044416","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.0.0.tgz","integrity":"sha512-G39ydHkoZmqk0KjaYFUMFdqZD7mv4owXs2GuS3XDSRV2iY/SY0JhF9nkTMWIsx9ecW3Wrmwz1r0Erh698c1BqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfdKTVmP1Q5Gk94zdCNxKBOtAdGUXwvS/vH9cKUbHpEAiBB3lOhpmWi/MxEexkEM3SJXbWLI3ZIbDak86eJWUwHwg=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.1.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.1.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.1.0","dist":{"shasum":"767002c153bad414b57e7d13272c6c332223d348","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.1.0.tgz","integrity":"sha512-qbfxMzUKbo/VOwQQP+k24gSm/xYDIqySg93FaFtu+ISuR8uiDJj0o7n0v4+3A/mO7trjxhXQNEdb/WVQ22L1/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmYiadjNddb87nqlHB2ncLFLqS94MziDTMhIoUKoSrrAiAd3Vd6Vqn4aqpUYpcibu5z9AWrGXai/chPP53pejdySw=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.1.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.1.1","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.1.1","dist":{"shasum":"23340a436a1c617f28cfd1935ab046e97776f2fd","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.1.1.tgz","integrity":"sha512-pVn4OAFUT6GFmUPkCl7cGHi0EG9DKbXYl+tnV31cNoixVSKFo93V0IcytuUB2XwmYgHVqjEoMI9Jr2cy8+37Pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIApXRtfHuil+Nsk//sL0504EqTc2ewyv055st8wuZkacAiBKYPrf/xCRCGvexWDmUiNwei0EgYPtEr2Ar6fqQlCIZA=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.2.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.2.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person();\n    person1.name = \"John Smith\";\n    person1.age = 30;\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.2.0","dist":{"shasum":"89b8e23d686188766e88573c6b4f98f3edbe3ff9","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.2.0.tgz","integrity":"sha512-hZo9+XH7hUdJhubMKckIuMkn2rJziQpGfYRRyEhTPKhPBaRWAjB4C55/BZVAM035ZHPZ+wsbx+GdhC2XGrE/tQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZU07o/sYMzqiSduQUeewDPwOS097M2dxZnUYo2zyVBAiBA5HHsCQnVKLbTotuTnSEaw4rkInU5BQye27jC/J3UyQ=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.2.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.2.1","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person();\n    person1.name = \"John Smith\";\n    person1.age = 30;\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.2.1","dist":{"shasum":"f9cb3c0cd9d688bb0a0ca550562594e2f987b877","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.2.1.tgz","integrity":"sha512-iYCTrZU2Hx33MQMU9KKfYzEosohAdd9qGV+juP4wGehLAsVfk+O6vop5THVi9RU1CHireA/vOM5grqhEgcaVFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYYYRgskP8f+/fL3F69sK9YPFjttcU1pyYepeFSWjtyQIhAKarxug8SStGMiILeQOetyiF8ugpBHpeiN2AsvdWskMw"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.3.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.3.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person();\n    person1.name = \"John Smith\";\n    person1.age = 30;\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </head>\n    <body>\n      <div>Sample...</div>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.3.0","dist":{"shasum":"aaa7f261477838b1cafa58e9854a0e432eef6aae","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.3.0.tgz","integrity":"sha512-SrBzdeTlkf0nsHXmOkaG5vM6WWg3o6Fhs5gxmbNW4Sa7AckI1+K8AEB8xzt4IUhGx8dTqjEkE02dBbBNpxXcAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmnNcHJcR4Ra3Qm1g0h9CRBIecd9Fruobt0TRfA8quqAIgGcSm/R9iFkExDQ4qTniF4U6igvXPoDzi8k2zG3zUPsk="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.4.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.4.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person();\n    person1.name = \"John Smith\";\n    person1.age = 30;\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    });\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.4.0","dist":{"shasum":"4a6c5a9b6ecfbca1709a86d65fcc19e5fcffa541","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.4.0.tgz","integrity":"sha512-SoDXDLQc+qxj36JD3zS6rJjYfRz/StbOkx3H3luy7kG20yHS58H0Jh8wqHaQb5imnkHB/c1HmCmgCYQdzu5zzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBf7PwHTXYWykpX5LR302U2o08Wtn0SAKs2BftxFxoCSAiEA/7B/Wsb7PUCu7TSuwC3W9wMV2lJoDxq98Hx91V9Z3Qk="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.4.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.4.1","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person();\n    person1.name = \"John Smith\";\n    person1.age = 30;\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    });\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.4.1","dist":{"shasum":"fa05ac09c73535032c295307f24365a1787d8837","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.4.1.tgz","integrity":"sha512-a7UxpiBahHHu9bp45w/fDInLes0FGyrNTMEwE5xyXKb6hFEkHxhpnUJvgV1yTGoXBPn686PpcXxfVM5vWOToPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC12af7Wc2LfGsQ5CMqFfHqFPfKIRv4XaHCJaO3wKNLjAiBP4ywk+l2kZBcL6uianPl2fBF6KuMUnmnnDdZ65HKBNg=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.4.2":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.4.2","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function (props) {\n        this.__name = null;\n        this.__age = 0;\n        if (props) {\n          $init(this, props);\n        }\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person({\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    });\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.4.2","dist":{"shasum":"a1421aa695d39f19f3b9825886bc5ac1b8d6872f","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.4.2.tgz","integrity":"sha512-FQ0e+CnA3FdbIoJOJCKGuRzF1FPs7Jc7iI+Ou4M8zIumIaiCGnKMXgnldrSOcnDX4M3V+Gqv53TZCMtEzXP9bg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIGA5kYzyr3jhyz4ZKCz8GSdPN3eYfJVcpGWSFFipFR+aAh9F7bcSJKOHSvHDJnpbvBg+IgfinrsYmGggvo73iP2g"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.4.3":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.4.3","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function (props) {\n        this.__name = null;\n        this.__age = 0;\n        if (props) {\n          $init(this, props);\n        }\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person1 = new Person({\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person1);\n    \n    var person2 = $create(Person, {\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person2);\n    \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person1);\n    organisation.add(person2);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    });\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.4.3","dist":{"shasum":"5cc17902d6b93f9646ffab7fd75b0a343a6ad844","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.4.3.tgz","integrity":"sha512-ysbPoZjhVGDaEjofkH0aJyc0jCXcVo6+KNX5yG2nbrhssDvrWSHlJ23z3IAZAGj2Vpo6XHlTMin10c8lEjs8mA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFZzespYQ/mhYO35Nok3L5+T97+YLM1DI6gvU39MgPagIgSO9sLZ7h/fsDJ606tkLih6oiT2bt3WQoGx8IVTdEOtg="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.4.4":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.4.4","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parent:Object): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IDrawable = $interface({\n    \n      visible: {\n        get: function () {\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n        }\n      },\n    \n      draw: function (context) {\n      } \n    \n    });\n    \n    var Rectangle = $class({\n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    });\n    \n    var person = new Person({\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.4.4","dist":{"shasum":"8131d89e01c54cfe86e8e606d98cdd1c30581df4","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.4.4.tgz","integrity":"sha512-qcmbR1dGi87VVuSkPSyI+xD/n8LFqkFvZXNDM9Tk9R4Wi6Wzm/8qXROFECjdNsqSPD9KKTuKMDVj9KQPtdLg3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfR3PsGWI+vt5cKF8W82pUyoY+rqj9wRxIftjlh6R7CAIgCglWNMyP4gXm6ICNYTb1EAYMri2J2qh+OXyEIuLgEbQ="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.5.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.5.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.5.0","dist":{"shasum":"e9960d7f8bb60ea8a76b57553b09739ef273822e","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.5.0.tgz","integrity":"sha512-k1l9QxrxNnO26nDXq9+YNJmcOuleiIBG4mk3+S7D6eiky0ohsGAG71b1+jftHw+OjRg9bIIQ8eybHbuoKcE47w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfZFPmBF1eG962zH/dV2nZq7ROjBKWbWdcEkt0UXPS0AIhAOka+RQQppusXyUjsLNTp0bvxvfpsSAhGMNuI6DtMeUj"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.6.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.6.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions","namespace"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.6.0","dist":{"shasum":"0c00c6bd6a6e24e545f94781a7071c093ff50b6b","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.6.0.tgz","integrity":"sha512-duXocELwP+EERyQ0uXOuC3cNyU+fZF/q/HeTzJ2eW0Fb4l8AV3uX7BZ1cY5ARDU4JvsXQP+jitld88401Q/ACw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnB8CwXhh/fKtXOZD82ExzZyLQb66+tFdV9FSSmiyWqAIhANY8MB8oeeh0lHzuhLwP9k23LWE4zCmhyqPCD42rd/mv"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.6.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.6.1","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions","namespace"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with nodejs and in the web browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.6.1","dist":{"shasum":"9d91d30ba3afedc7923cec39d458a075de3bd424","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.6.1.tgz","integrity":"sha512-tFuH7sWjPdiieyPnfiAWwoUZDdEmiqUt5EeNcI7vCE13D0NlC4sTpeaM2aKGWf570Q6jPl8IbvxDVGUKMlU2IA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDm8R4ZA6o4eGcLeRHSBSisUe9mSlipa064s1PVAxTJeAIhAOh1XxOens6UbdQGwV4JJAIikHOhkTsj43nCvgYYeKhc"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.6.2":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.6.2","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions","namespace","PhantomJS"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with NodeJS, PhantomJS and in the Web Browsers.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../lib/class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __NodeJS__. __Class4js__ package dedicated for \n__NodeJS__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.6.2","dist":{"shasum":"c7880aab69b1f82dae59bcf73b4ad450a890ad61","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.6.2.tgz","integrity":"sha512-r6gvDN3GGRIxKfMVQHt+KFkG24o91c7XGKsKttISqGRC2AKpmMVITb9o7Fdi9rk+I6SHx8Ju5OoejAoFSelqIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqqvQIWUcljKJaIFUujOX6tJ1Jisu32tdsiTtDQJVsoAiEAhE0ViLphXtegtgJOrj8aC6buHgAcijJBL3QQSCel7LQ="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.6.3":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.6.3","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions","namespace","PhantomJS"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with __Node.js__, __PhantomJS__ and in the __Web Browsers__.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.6.3","dist":{"shasum":"e6b46f6872bea1cf914a72b2948fd8ce5399637d","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.6.3.tgz","integrity":"sha512-AEpmmt43e5DPa4ZW2gzQ9RXtS5ZdVxpfbb3AiruzwAeY8PTXCmzl+GG35Mk2xrvWpIGyLpMdQC6sI6iT2Yn0yQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJWSHPkF8Sc8tw5J8QX35sGub7lnT/glh5I1wzudldEwIhAPnLrSQfDVGvR3zNrnggSTYecHEGI8t6kFZiCcDGTKXQ"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.6.4":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.6.4","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","interface","inheritance","constant","static","browser","prototype","extensions","namespace","PhantomJS","module"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with __Node.js__, __PhantomJS__ and in the __Web Browsers__.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(extension:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    class4js.Class.addExtension(function () {\n      if ($is(this, ICollection)) {\n        Object.defineProperty(this, \"forEach\", {\n          value: function (callback) {\n            for (var i = 0; i < this.items().length; i++) {\n              callback(this.items()[i]);\n            }   \n          },\n          writable: false,\n          enumerable: true,\n          configurable: false\n        });\n      }\n    }); \n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.6.4","dist":{"shasum":"00b9520c9d53140c3f70ec49be719ff2bd6a24e7","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.6.4.tgz","integrity":"sha512-Dapd+p96cmlYGZeh9vtYO9ZKZAq8mZCQe8XjwkdO7gro++ikeCcuzoPhmRAnN87ISXIv+C+SSSCzox9lzukz7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGcm+boXTwNVmrKTWh+3g8UdrFZnP+7NJd4pMYR2IpldAiBm4U9bnn4cWoECEEYIOG6/MmPQQBtWFOG/hKc97dafwA=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.7.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.7.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with __Node.js__, __PhantomJS__ and in the __Web Browsers__.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with \\_\\_ and protected with \\_.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(target:Object, name:String, value:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    $extend(ICollection, \"forEach\", function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.7.0","dist":{"shasum":"deaea4f5b63ebe7baac3b5ca4ec62232383b31e4","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.7.0.tgz","integrity":"sha512-6u9nLXRJJQjtfhSlpliVWMIcytSNjWnNrvavERtUB/MFEJ1sNzg4IlBKqX6nkVjw1FCOweESNxwZCK7e+vaMXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAURiklygSCRJpKYjGPzKJpLcMizBGsLgT/17YEpdDnfAiEAqyLRBK2fPXIoo9DBwVET9xicQd1MSV5nX+w4pvKR244="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.7.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.7.1","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\nThe library can be used with __Node.js__, __PhantomJS__ and in the __Web Browsers__.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with \\_\\_ and protected with \\_.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Object\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Enum\n\nCreates an enum:\n\n    class4js.Enum.create(fields:Object): Object\n\nor\n\n  $enum(fields:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var Priority = $enum({\n      low: 0,\n      normal: 1,\n      high: 2\n    });\n    \n    for (var field in Priority) {\n      console.log(field);\n    }\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(target:Object, name:String, value:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    $extend(ICollection, \"forEach\", function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.7.1","dist":{"shasum":"32f61cab171cda750d52ab9090e64fa5b78b4dfc","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.7.1.tgz","integrity":"sha512-/w77kn8Co7ln9lMdDL5Xlwf23d3HxqVgIK+qCwvikADpuDLlGMKCEkCyEV7QC/V9DU9kkkjMLHoIiBU0N65Guw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICSOkxu1iYIBOOWXwlGHDl1XeHlZhnhln2h0JycK9ugDAiEAknkuqhBZpZakW82ne3dyPdZLJ4L/XbcpqTpj3b88/ww="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.8.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.8.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n## Installation\n\n    npm install class4js\n\n## API\n\n### Create class\n\nPrivate class members are decorated with \\_\\_ and protected with \\_.\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Function\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = \"Component\";\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = \"Button\";\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members.\n\n    $static_class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n    \n    console.log(\"=== Static class: ===\");\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n    console.log(Counter.current);\n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Enum\n\nCreates an enum:\n\n    class4js.Enum.create(fields:Object): Object\n\nor\n\n    $enum(fields:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var Priority = $enum({\n      low: 0,\n      normal: 1,\n      high: 2\n    });\n    \n    for (var field in Priority) {\n      console.log(field);\n    }\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(target:Object, name:String, value:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    $extend(ICollection, \"forEach\", function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.8.0","dist":{"shasum":"5e58c065f8cb10da82f2928d06b93fb081b72ec4","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.8.0.tgz","integrity":"sha512-JNIwgoNsuHSrzTxrfLJWLJ8MNe7OSsUNg8znq6trRDby9NPTcH3rinU1zmf1BFSUAQlrSUOZ3Wmj+xjEIArEAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA86DTRmyAPXTQ1eR54KKf7Z9UiY1iuGcJQU/FlUlkgUAiA5coQDHWPErl3szhMJbektZVY4YL69IYb0v0K2LLRJjg=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.9.0":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.9.0","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * node.js\n* API\n* License\n\n## Installation\n\n### node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n## API\n\n### Class\n\nPrivate class members are decorated with \\_\\_ and protected with \\_.\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object, interfaces:Array): Function\n\nor\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = \"Component\";\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = \"Button\";\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members.\n\n    $static_class(properties:Object, parent:Object, interfaces:Array): Object\n\n__Example__\n\n    \"use strict\";\n    \n    console.log(\"=== Static class: ===\");\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n    console.log(Counter.current);\n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n### Namespaces\n\nCreates a namespace:\n\n    class4js.Namespace.create(name:String): void\n\nor\n\n    $namespace(name:String): void\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"../../lib/class4js.js\");\n    \n    $namespace(\"org.myapp.util\");\n    \n    org.myapp.util = (function () {\n    \n      var util = {};\n    \n      return util;\n    \n    }());\n    \n    console.log(org);\n\n### Interfaces\n\nCreates an interfaces: \n\n    class4js.Interface.create(properties:Object, parents:Array): Object\n\nor\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatable with given interface\n\n    class4js.Interface.instanceOf(source:Object, target:Object): Boolean\n\nor\n\n    $is(source:Object, target:Object): Boolean \n\nAn interface can inherit or more other interfaces.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var IComponent = $interface({ \n      id: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      visible: {\n        get: function () {}\n      },\n      drawOrder: {\n        get: function () {}\n      },\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Rectangle = $class({\n    \n      __construct__: function (visible, drawOrder) {\n        this.__visible = visible;\n        this.__drawOrder = drawOrder;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        }\n      },\n    \n      visible: {\n        get: function () {\n          return this.__visible;\n        }\n      },\n    \n      drawOrder: {\n        get: function () {\n          return this.__drawOrder;\n        }\n      },\n    \n      draw: function (context) {\n        console.log(\"Rectangle is drawn...\");\n      } \n    \n    }, null, IDrawable);\n    \n    var rec = new Rectangle(true, 10);\n    \n    console.log($is(rec, IDrawable));\n\n### Object factory\n\nCreates new object by given type and copies properties values to created object:\n\n    class4js.ObjectFactory.create(type:Function, options:Object): Object\n\nor\n\n    $create(type:Function, options:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var Entity = $class({\n    \n      __construct__: function () {\n        this.__id = 0;\n      },\n    \n      id: {\n        get: function () {\n          return this.__id;\n        },\n        set: function (value) {\n          this.__id = value;\n        }\n      }\n    \n    });\n    \n    var Person = $class({\n      \n      __construct__: function () {\n        this.__name = null;\n        this.__age = 0;\n      },\n    \n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n    \n      age: {\n        get: function () {\n          return this.__age;\n        },\n        set: function (value) {\n          this.__age = value;\n        }\n      }\n    \n    }, Entity);\n    \n    var person = new Person({\n      id: 10,\n      name: \"John Smith\",\n      age: 30\n    });\n    console.log(person);\n        \n    var Organisation = $class({\n    \n      __construct__: function () {\n        this.__persons = [];\n      },\n    \n      add: function (person) {\n        this.__persons.push($create(Person, person));\n      }\n    \n    });\n    \n    var organisation = new Organisation();\n    \n    organisation.add(person);\n    organisation.add({\n      id: 24,\n      name: \"Peter Joe\",\n      age: 42\n    });\n    \n    console.log(organisation);\n\n### Modules\n\nModules were included to class4js for better compatability with browsers, because\nin browsers were no build in module system like in nodejs. In nodejs module wrapps \nnodejs module systems loading.\n\nCreates an module:\n\n    class4js.Module.create(scope:Function): Object\n\nor\n\n    $module(scope:Function): Object\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js.js\");\n    \n    var util = $module(function (exports) {\n    \n      var Reader = $class({\n       \n        __construct__: function () {\n        },\n    \n        read: function () {\n          console.log(\"Reading...\");  \n        } \n      \n      }); \n    \n      exports.Reader = Reader;\n    \n    });\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Enum\n\nCreates an enum:\n\n    class4js.Enum.create(fields:Object): Object\n\nor\n\n    $enum(fields:Object): Object\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var Priority = $enum({\n      low: 0,\n      normal: 1,\n      high: 2\n    });\n    \n    for (var field in Priority) {\n      console.log(field);\n    }\n\n### Extensions\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    class4js.Class.addExtension(target:Object, name:String, value:Function): void\n\n__Example__\n\n    \"use strict\";\n    \n    var class4js = require(\"../../lib/class4js.js\");\n    \n    var ICollection = $interface({\n    \n      items: function() {\n      }\n    \n    });\n    \n    var Collection = $class({\n      \n      __construct__: function (items) {\n        this.__items = items;\n      },\n    \n      items: function () {\n        return this.__items;\n      }\n    \n    }, null, ICollection);\n    \n    $extend(ICollection, \"forEach\", function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    \n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n### Web browsers\n\nIf you want to use __class4js__ in the web browser, simply include __class4js.min.js__\nfile to your page.\n\n__index.html__\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <title>Samples</title>\n    </head>\n    <body>\n      <div>Sample...</div>\n      <script src=\"class4js.min.js\"></script>\n      <script src=\"sample.js\"></script>\n    </body>\n    </html>\n\n__sample.js__\n\n    (function () {\n    \n      \"use strict\";\n    \n      var Person = $class({\n        __construct__: function (name) {\n          this.__name = name;\n          console.log(\"ctor\");\n        },\n        getName: function () {\n          return this.__name;\n        }\n      });\n    \n      var person = new Person(\"John Smith\");\n    \n      console.log(person.getName());\n    \n    }());\n\n### PhantomJS\n\n__PhantomJS__ is very similar to the __Node.js__. __class4js__ package dedicated for \n__Node.js__ can be taken and used in __PhantomJS__ without any modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"./class4js.js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    \n    phantom.exit();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.9.0","dist":{"shasum":"6e6a551108c38864263656cdedf05c46479df684","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.9.0.tgz","integrity":"sha512-Crf4D1+M/9uM+IbSN4T2x30oPMo7rxZd/dcHmm3VbyJLIYa0gn+o07CF/H84d3v8DDrSjOuHAGoSNDR1kshw/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEcPTEoTR7KqJN+KgiOG0FYxumoy6MtN52kLevywfZnnAiEA6qy9FjiRtCsk3kzmCY/+rLASC6VHvqO9762X2CFVE98="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.9.1":{"name":"class4js","description":"The class4j library is for class-driven development in JavaScript.","version":"1.9.1","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\r\n\r\n[http://www.class4js.com](http://www.class4js.com)\r\n\r\nThe __class4js__ module is for class-driven development in JavaScript. It \r\nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \r\nimplements open/close principle:  _\"When class is created, class is closed for \r\nmodifications\"_. __class4js__  is free software distributed under the terms of \r\nthe _GNU General Public License version 3_ and can be used with __node.js__, \r\n__modern web browsers__ and even with __PhantomJS__.\r\n\r\n    // Simple class example:\r\n    \r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      },\r\n      draw: function () {\r\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\r\n      }, \r\n      moveTo: function (x, y) {\r\n        this.x = x;\r\n        this.y = y;\r\n      }\r\n    });\r\n    \r\n    var shape = new Shape({ x: 100, y: 100 });\r\n    shape.moveTo(120, 85);\r\n    shape.draw();\r\n    \r\n    // Output:\r\n    // Drawing shape at: (120, 85)\r\n\r\n## Overview\r\n\r\n* Installation\r\n  * Node.js\r\n  * Web Browser\r\n  * PhantomJS\r\n* API\r\n  * Class\r\n      * Constructor\r\n      * Static Constructor\r\n      * Object initializer\r\n      * Constant\r\n      * Fields\r\n      * Properties\r\n      * Static Members\r\n      * Inheritance\r\n  * Abstract Class\r\n  * Static Class\r\n  * Enum\r\n  * Interface \r\n  * Object Factory\r\n  * Modules\r\n  * Namespace\r\n  * Extensions\r\n* License\r\n\r\n## Installation\r\n\r\n### Node.js\r\n\r\nTo install __class4js__ module for node.js, this command should be used:\r\n\r\n    npm install class4js\r\n\r\nAlso __class4js__ module's loading statement should be added to main module:\r\n\r\n    'use strict';\r\n    \r\n    require('class4js');\r\n    \r\n    // Your code goes here...\r\n\r\n### Web Browser\r\n\r\nTo use __class4js__ module in web browser, simply download newest minified \r\n__class4js__ module file and include it to your browsers. You can also define \r\nmain module of application:\r\n\r\n    <!DOCTYPE HTML>\r\n    <html>\r\n    <head>\r\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\r\n    </head>\r\n    <body>\r\n      <!-- Your code goes here... -->\r\n    </body>\r\n    </html>\r\n\r\n### PhantomJS\r\n\r\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \r\nPhantomJS executor and include __class4js__ module's loading statement to main \r\nmodule:\r\n\r\n    'use strict';\r\n    \r\n    require('./class4js.js');\r\n    \r\n    // Your code goes here...\r\n\r\n### NuGet\r\n\r\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \r\ninstall class4js, run the following command in the package manager console.\r\n\r\n    Install-Package class4js\r\n\r\n## API\r\n\r\n### Class\r\n\r\nA class is a construct that is used to create instances of itself. A class defines \r\nconstituent members which enable its instances to have state and behavior. \r\nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \r\ndeclared by using the keyword __$class__:\r\n\r\n    $class(properties:Object, parent:Object, interfaces:Array): Function\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      },\r\n      draw: function () {\r\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\r\n      }, \r\n      moveTo: function (x, y) {\r\n        this.x = x;\r\n        this.y = y;\r\n      }\r\n    });\r\n    \r\n    var shape = new Shape({ x: 100, y: 100 });\r\n    shape.moveTo(120, 85);\r\n    shape.draw();   \r\n\r\n#### Constructor\r\n\r\nWhenever a class is created, its constructor is called. Name for a constructor \r\nis *\\_\\_construct\\_\\_*.\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        // Your code goes here...\r\n      }\r\n    });\r\n\r\n#### Static Constructor\r\n\r\nStatic constructor is a static data initializer. Static constructors are called \r\nwhen the class is defined. Name for a static constructor is the same as ordinal \r\nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\r\n\r\n__Example__:\r\n\r\n    var Shape = $class({\r\n      __static__: {\r\n        __construct__: function () {\r\n          // Your code goes here...\r\n        }\r\n      }\r\n    });\r\n\r\n#### Object Initializer\r\n\r\nObject can be initialized with anonymous object. All properties from anonymous \r\nobject are copied to the target object.\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      }\r\n    });\r\n    \r\n    var shape = new Shape({ x: 100, y: 100 });\r\n\r\n#### Constant\r\n\r\nA constant is a class member which value can't be changed. Constant names should \r\nbe in uppercasing.\r\n\r\n__Example:__\r\n\r\n    var Calendar = $class({\r\n      MONTHS: 12,\r\n      WEEKS: 52,\r\n      DAYS: 365,\r\n    });\r\n\r\n#### Fields\r\n\r\nAll class fields should be defined as class members or initialized in constructor, \r\nbecause when class is created, class is closed for modifications.\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __x: 0,\r\n      __y: 0\r\n    });\r\n\r\n#### Properties\r\n\r\nA property is a member that provides a flexible mechanism to read, write, or \r\ncompute the value of a private field.\r\n\r\n__Example__:\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      }\r\n    });\r\n\r\n#### Static members\r\n\r\nStatic class members are used to create data and functions that can be accessed \r\nwithout creating an instance of the class. All static class members should be \r\nmust be surrounded by *\\_\\_static\\_\\_* statement.\r\n\r\n__Example:__\r\n\r\n    var Calculator = $class({\r\n      __static__: {\r\n        sum: function (a, b) {\r\n          return a + b;\r\n        },\r\n        subtract: function (a, b) {\r\n          return a - b;\r\n        }\r\n      }\r\n    });\r\n    \r\n    var result = Calculator.sum(2, 2);\r\n\r\n#### Inheritance\r\n\r\nInheritance is a way to reuse code and to establish a subtype from an existing \r\nobject. Constructor inheritance is also supported. To access parent's methods \r\nproperty *\\_super* should be used.\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      },\r\n      draw: function () {\r\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\r\n      }\r\n    });\r\n    \r\n    var Rectangle = $class({\r\n      __construct__: function () {\r\n        this.__width = 0;\r\n        this.__height = 0;\r\n      },\r\n      width: {\r\n        get: function () {\r\n          return this.__width;\r\n        },\r\n        set: function (value) {\r\n          this.__width = value;\r\n        }\r\n      },\r\n      height: {\r\n        get: function () {\r\n          return this.__height;\r\n        },\r\n        set: function (value) {\r\n          this.__height = value;\r\n        }\r\n      },\r\n      draw: function () {\r\n        this.__super.draw();\r\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \r\n          + \") at: (\" + this.x + \", \" + this.y + \")\");\r\n      }\r\n    }, Shape);\r\n    \r\n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\r\n    shape.draw();\r\n\r\n### Abstract Class\r\n\r\nAbstract class is intended only to be a base class of other classes. Abstract \r\nclass can't be  instantiated. Abstract classes are declared by using the keyword \r\n__$abstract_class__.\r\n\r\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\r\n\r\n__Example:__\r\n\r\n    var Component = $abstract_class({\r\n      __construct__: function () { \r\n        this.__name = 'Component';\r\n      },\r\n      name: { \r\n        get: function () { \r\n          return this.__name; \r\n        },\r\n        set: function (value) { \r\n          this.__name = value; \r\n        }\r\n      }\r\n    }); \r\n    \r\n    var Button = $class({\r\n      __construct__: function () {\r\n        this.name = 'Button1';\r\n      }\r\n    }, Component)\r\n    \r\n    try {\r\n      var component = new Component(); \r\n    } catch (ex) {\r\n      console.log(ex.message);\r\n    } \r\n    \r\n    var button = new Button();\r\n\r\n### Static Class\r\n\r\nStatic class can't be initialized or inherited and contains only static members. \r\nAbstract classes are declared by using the keyword __$static_class__.\r\n\r\n    $static_class(properties:Object): Object\r\n\r\n__Example:__\r\n\r\n    var Counter = $static_class({\r\n      __construct__: function () {\r\n        this.__value = 0;\r\n      },\r\n      increment: function () {\r\n        this.__value++;\r\n      },\r\n      current: {\r\n        get: function () {\r\n          return this.__value;\r\n        }\r\n      }\r\n    });\r\n    \r\n    Counter.increment();\r\n\r\n### Enum\r\n\r\n__$enum__ keyword can be used to set up collections of named integer constants.\r\n\r\n    $enum(fields:Object): Object\r\n\r\n__Example:__\r\n\r\n    var Priority = $enum({\r\n      low: 0,\r\n      normal: 1,\r\n      high: 2\r\n    });\r\n\r\n### Interface\r\n\r\nInterfaces form a contract between the class and the outside world. If your class \r\nclaims to implement an interface, all methods defined by that interface must \r\nappear in its source code. Interfaces are declared by using the keyword __$interface__.\r\n\r\n    $interface(properties:Object, parent:Object): Object\r\n\r\nYou can check if object is compatible with given interface or inherit given class.\r\n\r\n    $is(source:Object, target:Object): Boolean \r\n\r\nA class can inherit one or more interfaces.\r\n\r\n__Example:__\r\n\r\n    var IComponent = $interface({ \r\n      name: {\r\n        get: function () {}\r\n      }\r\n    });\r\n    \r\n    var IDrawable = $interface({\r\n      draw: function (context) {} \r\n    }, IComponent);\r\n    \r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__name = 'Shape';\r\n      },\r\n      name: {\r\n        get: function () {\r\n          return this.__name;\r\n        }\r\n      },\r\n      draw: function () {\r\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\r\n      }\r\n    }, IDrawable);\r\n    \r\n    var shape = new Shape();\r\n    \r\n    console.log($is(shape, IDrawable));\r\n\r\n### Object factory\r\n\r\nObject can be created by given type and initialized from anonymous object. To \r\naccomplish such task keyword __$create__ is used.\r\n\r\n    $create(type:Function, options:Object): Object\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      }\r\n    });\r\n    \r\n    var Layer = $class({\r\n      __construct__: function () {\r\n        this.__shapes = [];\r\n      },\r\n      add: function (options) {\r\n        this.__shapes.push($create(Shape, options));\r\n      }\r\n    });\r\n    \r\n    var layer = new Layer();\r\n    layer.add({ x: 10, y: 10 });\r\n\r\nAll properties from anonymous object can be copied to existing object. To \r\naccomplish such task keyword __$init__ is used.\r\n\r\n__Example:__\r\n\r\n    var Shape = $class({\r\n      __construct__: function () {\r\n        this.__x = 0;\r\n        this.__y = 0;\r\n      },\r\n      x: {\r\n        get: function () {\r\n          return this.__x;\r\n        },\r\n        set: function (value) {\r\n          this.__x = value;\r\n        }\r\n      },\r\n      y: {\r\n        get: function () {\r\n          return this.__y;\r\n        },\r\n        set: function (value) {\r\n          this.__y = value;\r\n        }\r\n      }\r\n    });\r\n    \r\n    var shape = new Shape();\r\n    $init(shape, { x: 10, y: 10 });\r\n\r\n### Module\r\n\r\nModules were included to __class4js__ for better compatability with browsers.\r\nBrowsers don't have a built in module system. In Node.js modules are based\r\non internal module loading. Modules are declared by using the keyword __$module__.\r\n\r\n    $module(scope:Function, dependencies:Array): Object\r\n\r\n__Example:__\r\n\r\n    $config({\r\n      debug: true,\r\n      modules: [{\r\n        name: 'a',\r\n        path: './a.js'\r\n      }]\r\n    });\r\n\r\n    var external_module = {};\r\n    \r\n    var util = $module(function (fs, a, em, exports, global) {\r\n      var Reader = $class({\r\n        __construct__: function () {\r\n        },  \r\n        read: function () {\r\n          console.log(\"Reading...\");  \r\n        }  \r\n      }); \r\n      exports.Reader = Reader;\r\n    }, ['fs', 'a', external_module]);\r\n    \r\n    var reader = new util.Reader();\r\n    reader.read();\r\n\r\n### Namespace\r\n\r\nNamespaces are declared using the keyword __$namespace__.\r\n\r\n    $namespace(name:String): void\r\n\r\n__Example:__\r\n\r\n    $namespace('org.myapp.util');\r\n    \r\n    org.myapp.util = (function () {\r\n      var util = {};\r\n      return util;\r\n    }());\r\n    \r\n    console.log(org);\r\n\r\n### Extension\r\n\r\nExtensions enables you to add methods to existing types without creating a new \r\nderived type.\r\n\r\n    $extend(target:Object, name:String, value:Function): void\r\n\r\n__Example:__\r\n\r\n    var ICollection = $interface({\r\n      items: function() {\r\n      }\r\n    });\r\n    \r\n    var Collection = $class({\r\n      __construct__: function (items) {\r\n        this.__items = items;\r\n      },\r\n      items: function () {\r\n        return this.__items;\r\n      }\r\n    }, ICollection);\r\n    \r\n    $extend(ICollection, 'forEach', function (callback) {\r\n      if (callback) {\r\n        for (var i = 0; i < this.items().length; i++) {\r\n          callback(this.items()[i]);\r\n        } \r\n      } \r\n    });\r\n    \r\n    var collection = new Collection([1, 2, 3]);\r\n    collection.forEach(function (item) {\r\n      console.log(item);\r\n    });\r\n\r\n## License\r\n\r\nThis software is distributed under the terms of the GNU General Public License, \r\nversion 3 (GPL-3.0).\r\n","readmeFilename":"readme.md","_id":"class4js@1.9.1","dist":{"shasum":"1628ed769fe142ebc477220994880bc85afac494","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.9.1.tgz","integrity":"sha512-8IqzcSw10HLUzAyR0d4/ROHqCLjyKpc6W8E3vSzolFS5V8bL/a1iQ6kDCNJXVQWH8Xd/KmDlVj0xn2YxEEuGsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrIozpYXdXhy9i2ojHWglt0TzAA5qVRHBpNDUJQPXf+AiA13w+fIbMi+mIbURbR2b9Y4O3QU1QvacVHA6b5adyRWg=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.9.2":{"name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","version":"1.9.2","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\n[http://www.class4js.com](http://www.class4js.com)\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * Node.js\n  * Web Browser\n  * PhantomJS\n* API\n  * Class\n      * Constructor\n      * Static Constructor\n      * Object initializer\n      * Constant\n      * Fields\n      * Properties\n      * Static Members\n      * Inheritance\n  * Abstract Class\n  * Static Class\n  * Enum\n  * Interface \n  * Object Factory\n  * Modules\n  * Namespace\n  * Extensions\n* License\n\n## Installation\n\n### Node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n### Web Browser\n\nTo use __class4js__ module in web browser, simply download newest minified \n__class4js__ module file and include it to your browsers. You can also define \nmain module of application:\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\n    </head>\n    <body>\n      <!-- Your code goes here... -->\n    </body>\n    </html>\n\n### PhantomJS\n\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \nPhantomJS executor and include __class4js__ module's loading statement to main \nmodule:\n\n    'use strict';\n    \n    require('./class4js.js');\n    \n    // Your code goes here...\n\n### NuGet\n\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \ninstall class4js, run the following command in the package manager console.\n\n    Install-Package class4js\n\n## API\n\n### Class\n\nA class is a construct that is used to create instances of itself. A class defines \nconstituent members which enable its instances to have state and behavior. \nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \ndeclared by using the keyword __$class__:\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();   \n\n#### Constructor\n\nWhenever a class is created, its constructor is called. Name for a constructor \nis *\\_\\_construct\\_\\_*.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        // Your code goes here...\n      }\n    });\n\n#### Static Constructor\n\nStatic constructor is a static data initializer. Static constructors are called \nwhen the class is defined. Name for a static constructor is the same as ordinal \nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example__:\n\n    var Shape = $class({\n      __static__: {\n        __construct__: function () {\n          // Your code goes here...\n        }\n      }\n    });\n\n#### Object Initializer\n\nObject can be initialized with anonymous object. All properties from anonymous \nobject are copied to the target object.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n\n#### Constant\n\nA constant is a class member which value can't be changed. Constant names should \nbe in uppercasing.\n\n__Example:__\n\n    var Calendar = $class({\n      MONTHS: 12,\n      WEEKS: 52,\n      DAYS: 365,\n    });\n\n#### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example:__\n\n    var Shape = $class({\n      __x: 0,\n      __y: 0\n    });\n\n#### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field.\n\n__Example__:\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n\n#### Static members\n\nStatic class members are used to create data and functions that can be accessed \nwithout creating an instance of the class. All static class members should be \nmust be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example:__\n\n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    });\n    \n    var result = Calculator.sum(2, 2);\n\n#### Inheritance\n\nInheritance is a way to reuse code and to establish a subtype from an existing \nobject. Constructor inheritance is also supported. To access parent's method, \nargument *$super* should be used. It must be the first argument in method definition.\n*$super* argument is optional.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n        this.__width = 0;\n        this.__height = 0;\n      },\n      width: {\n        get: function () {\n          return this.__width;\n        },\n        set: function (value) {\n          this.__width = value;\n        }\n      },\n      height: {\n        get: function () {\n          return this.__height;\n        },\n        set: function (value) {\n          this.__height = value;\n        }\n      },\n      draw: function ($super) {\n        $super.draw();\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \n          + \") at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, Shape);\n    \n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\n    shape.draw();\n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated. Abstract classes are declared by using the keyword \n__$abstract_class__.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = 'Component';\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = 'Button1';\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members. \nAbstract classes are declared by using the keyword __$static_class__.\n\n    $static_class(properties:Object): Object\n\n__Example:__\n\n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n\n### Enum\n\n__$enum__ keyword can be used to set up collections of named integer constants.\n\n    $enum(fields:Object): Object\n\n__Example:__\n\n    var Priority = $enum({\n      LOW: 0,\n      NORMAL: 1,\n      HIGH: 2\n    });\n\n### Interface\n\nInterfaces form a contract between the class and the outside world. If your class \nclaims to implement an interface, all methods defined by that interface must \nappear in its source code. Interfaces are declared by using the keyword __$interface__.\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatible with given interface or inherit given class.\n\n    $is(source:Object, target:Object): Boolean \n\nA class can inherit one or more interfaces.\n\n__Example:__\n\n    var IComponent = $interface({ \n      name: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__name = 'Shape';\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, IDrawable);\n    \n    var shape = new Shape();\n    \n    console.log($is(shape, IDrawable));\n\n### Object factory\n\nObject can be created by given type and initialized from anonymous object. To \naccomplish such task keyword __$create__ is used.\n\n    $create(type:Function, options:Object): Object\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var Layer = $class({\n      __construct__: function () {\n        this.__shapes = [];\n      },\n      add: function (options) {\n        this.__shapes.push($create(Shape, options));\n      }\n    });\n    \n    var layer = new Layer();\n    layer.add({ x: 10, y: 10 });\n\nAll properties from anonymous object can be copied to existing object. To \naccomplish such task keyword __$init__ is used.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape();\n    $init(shape, { x: 10, y: 10 });\n\n### Module\n\nModules were included to __class4js__ for better compatability with browsers.\nBrowsers don't have a built in module system. In Node.js modules are based\non internal module loading. Modules are declared by using the keyword __$module__.\n\n    $module(scope:Function, dependencies:Array): Object\n\n__Example:__\n\n    $config({\n      debug: true,\n      modules: [{\n        name: 'a',\n        path: './a.js'\n      }]\n    });\n\n    var external_module = {};\n    \n    var util = $module(function (fs, a, em, exports, global) {\n      var Reader = $class({\n        __construct__: function () {\n        },  \n        read: function () {\n          console.log(\"Reading...\");  \n        }  \n      }); \n      exports.Reader = Reader;\n    }, ['fs', 'a', external_module]);\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Namespace\n\nNamespaces are declared using the keyword __$namespace__.\n\n    $namespace(name:String): void\n\n__Example:__\n\n    $namespace('org.myapp.util');\n    \n    org.myapp.util = (function () {\n      var util = {};\n      return util;\n    }());\n    \n    console.log(org);\n\n### Extension\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    $extend(target:Object, name:String, value:Function): void\n\n__Example:__\n\n    var ICollection = $interface({\n      items: function() {\n      }\n    });\n    \n    var Collection = $class({\n      __construct__: function (items) {\n        this.__items = items;\n      },\n      items: function () {\n        return this.__items;\n      }\n    }, ICollection);\n    \n    $extend(ICollection, 'forEach', function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","_id":"class4js@1.9.2","dist":{"shasum":"225e5188793698c08eeb99964f42385689bb6fd6","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.9.2.tgz","integrity":"sha512-+1q2PJVJI3jZIwOaxVLOSgnoq/hSe3T6IdQePVy1iTJ4QzOx3YDyqyonql9TFnpCSX5+fFf3cTQ8BwfhtUKrMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeASvrSobPARB7kgRCy44j7AbvaYzgX7sT3tZapJhfRwIgK/tFtekXVf0XkYjnikOMVhdt5Gnwa5415e5rPr8m670="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.10.0":{"name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","version":"1.10.0","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\n[http://www.class4js.com](http://www.class4js.com)\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * Node.js\n  * Web Browser\n  * PhantomJS\n* API\n  * Class\n      * Constructor\n      * Static Constructor\n      * Object initializer\n      * Constant\n      * Fields\n      * Properties\n      * Static Members\n      * Inheritance\n  * Abstract Class\n  * Static Class\n  * Enum\n  * Interface \n  * Object Factory\n  * Modules\n  * Namespace\n  * Extensions\n* License\n\n## Installation\n\n### Node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n### Web Browser\n\nTo use __class4js__ module in web browser, simply download newest minified \n__class4js__ module file and include it to your browsers. You can also define \nmain module of application:\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\n    </head>\n    <body>\n      <!-- Your code goes here... -->\n    </body>\n    </html>\n\n### PhantomJS\n\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \nPhantomJS executor and include __class4js__ module's loading statement to main \nmodule:\n\n    'use strict';\n    \n    require('./class4js.js');\n    \n    // Your code goes here...\n\n### NuGet\n\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \ninstall class4js, run the following command in the package manager console.\n\n    Install-Package class4js\n\n## API\n\n### Class\n\nA class is a construct that is used to create instances of itself. A class defines \nconstituent members which enable its instances to have state and behavior. \nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \ndeclared by using the keyword __$class__:\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();   \n\n#### Constructor\n\nWhenever a class is created, its constructor is called. Name for a constructor \nis *\\_\\_construct\\_\\_*.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        // Your code goes here...\n      }\n    });\n\n#### Static Constructor\n\nStatic constructor is a static data initializer. Static constructors are called \nwhen the class is defined. Name for a static constructor is the same as ordinal \nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example__:\n\n    var Shape = $class({\n      __static__: {\n        __construct__: function () {\n          // Your code goes here...\n        }\n      }\n    });\n\n#### Object Initializer\n\nObject can be initialized with anonymous object. All properties from anonymous \nobject are copied to the target object.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n\n#### Constant\n\nA constant is a class member which value can't be changed. Constant names should \nbe in uppercasing.\n\n__Example:__\n\n    var Calendar = $class({\n      MONTHS: 12,\n      WEEKS: 52,\n      DAYS: 365,\n    });\n\n#### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example:__\n\n    var Shape = $class({\n      __x: 0,\n      __y: 0\n    });\n\n#### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field.\n\n__Example__:\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n\n#### Static members\n\nStatic class members are used to create data and functions that can be accessed \nwithout creating an instance of the class. All static class members should be \nmust be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example:__\n\n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    });\n    \n    var result = Calculator.sum(2, 2);\n\n#### Inheritance\n\nInheritance is a way to reuse code and to establish a subtype from an existing \nobject. Constructor inheritance is also supported. To access parent's method, \nargument *$super* should be used. It must be the first argument in method definition.\n*$super* argument is optional.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n        this.__width = 0;\n        this.__height = 0;\n      },\n      width: {\n        get: function () {\n          return this.__width;\n        },\n        set: function (value) {\n          this.__width = value;\n        }\n      },\n      height: {\n        get: function () {\n          return this.__height;\n        },\n        set: function (value) {\n          this.__height = value;\n        }\n      },\n      draw: function ($super) {\n        $super.draw();\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \n          + \") at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, Shape);\n    \n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\n    shape.draw();\n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated. Abstract classes are declared by using the keyword \n__$abstract_class__.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = 'Component';\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = 'Button1';\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members. \nAbstract classes are declared by using the keyword __$static_class__.\n\n    $static_class(properties:Object): Object\n\n__Example:__\n\n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n\n### Enum\n\n__$enum__ keyword can be used to set up collections of named integer constants.\n\n    $enum(fields:Object): Object\n\n__Example:__\n\n    var Priority = $enum({\n      LOW: 0,\n      NORMAL: 1,\n      HIGH: 2\n    });\n\n### Interface\n\nInterfaces form a contract between the class and the outside world. If your class \nclaims to implement an interface, all methods defined by that interface must \nappear in its source code. Interfaces are declared by using the keyword __$interface__.\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatible with given interface or inherit given class.\n\n    $is(source:Object, target:Object): Boolean \n\nA class can inherit one or more interfaces.\n\n__Example:__\n\n    var IComponent = $interface({ \n      name: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__name = 'Shape';\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, IDrawable);\n    \n    var shape = new Shape();\n    \n    console.log($is(shape, IDrawable));\n\n### Object factory\n\nObject can be created by given type and initialized from anonymous object. To \naccomplish such task keyword __$create__ is used.\n\n    $create(type:Function, options:Object): Object\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var Layer = $class({\n      __construct__: function () {\n        this.__shapes = [];\n      },\n      add: function (options) {\n        this.__shapes.push($create(Shape, options));\n      }\n    });\n    \n    var layer = new Layer();\n    layer.add({ x: 10, y: 10 });\n\nAll properties from anonymous object can be copied to existing object. To \naccomplish such task keyword __$init__ is used.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape();\n    $init(shape, { x: 10, y: 10 });\n\n### Module\n\nModules were included to __class4js__ for better compatability with browsers.\nBrowsers don't have a built in module system. In Node.js modules are based\non internal module loading. Modules are declared by using the keyword __$module__.\n\n    $module(scope:Function, dependencies:Array): Object\n\n__Example:__\n\n    $config({\n      debug: true,\n      modules: [{\n        name: 'a',\n        path: './a.js'\n      }]\n    });\n\n    var external_module = {};\n    \n    var util = $module(function (fs, a, em, exports, global) {\n      var Reader = $class({\n        __construct__: function () {\n        },  \n        read: function () {\n          console.log(\"Reading...\");  \n        }  \n      }); \n      exports.Reader = Reader;\n    }, ['fs', 'a', external_module]);\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Namespace\n\nNamespaces are declared using the keyword __$namespace__.\n\n    $namespace(name:String): void\n\n__Example:__\n\n    $namespace('org.myapp.util');\n    \n    org.myapp.util = (function () {\n      var util = {};\n      return util;\n    }());\n    \n    console.log(org);\n\n### Extension\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    $extend(target:Object, name:String, value:Function): void\n\n__Example:__\n\n    var ICollection = $interface({\n      items: function() {\n      }\n    });\n    \n    var Collection = $class({\n      __construct__: function (items) {\n        this.__items = items;\n      },\n      items: function () {\n        return this.__items;\n      }\n    }, ICollection);\n    \n    $extend(ICollection, 'forEach', function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","readmeFilename":"readme.md","_id":"class4js@1.10.0","dist":{"shasum":"f7d800992fd58ab00dcd4bfad3470dff9074b6dc","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.10.0.tgz","integrity":"sha512-Q2M6vh7acf0M4BMTtpTIt8aI0QbdstiiBbWxurCdLCZE+7n+NUmRKnBxOEW55f+TpI/s4DlEteezfAV83GzR3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcKZR9bd8ZBhdHoNTLSP73PQPRbNKMeb6Tjj9RGyt/vgIhAKiRD2hcxMwMkD9n+AOM756UEByXtIKHpZY4I6RTvxnM"}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.10.1":{"name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","version":"1.10.1","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\n[http://www.class4js.com](http://www.class4js.com)\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * Node.js\n  * Web Browser\n  * PhantomJS\n* API\n  * Class\n      * Constructor\n      * Static Constructor\n      * Object initializer\n      * Constant\n      * Fields\n      * Properties\n      * Static Members\n      * Inheritance\n  * Abstract Class\n  * Static Class\n  * Enum\n  * Interface \n  * Object Factory\n  * Modules\n  * Namespace\n  * Extensions\n* License\n\n## Installation\n\n### Node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n### Web Browser\n\nTo use __class4js__ module in web browser, simply download newest minified \n__class4js__ module file and include it to your browsers. You can also define \nmain module of application:\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\n    </head>\n    <body>\n      <!-- Your code goes here... -->\n    </body>\n    </html>\n\n### PhantomJS\n\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \nPhantomJS executor and include __class4js__ module's loading statement to main \nmodule:\n\n    'use strict';\n    \n    require('./class4js.js');\n    \n    // Your code goes here...\n\n### NuGet\n\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \ninstall class4js, run the following command in the package manager console.\n\n    Install-Package class4js\n\n## API\n\n### Class\n\nA class is a construct that is used to create instances of itself. A class defines \nconstituent members which enable its instances to have state and behavior. \nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \ndeclared by using the keyword __$class__:\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();   \n\n#### Constructor\n\nWhenever a class is created, its constructor is called. Name for a constructor \nis *\\_\\_construct\\_\\_*.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        // Your code goes here...\n      }\n    });\n\n#### Static Constructor\n\nStatic constructor is a static data initializer. Static constructors are called \nwhen the class is defined. Name for a static constructor is the same as ordinal \nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example__:\n\n    var Shape = $class({\n      __static__: {\n        __construct__: function () {\n          // Your code goes here...\n        }\n      }\n    });\n\n#### Object Initializer\n\nObject can be initialized with anonymous object. All properties from anonymous \nobject are copied to the target object.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n\n#### Constant\n\nA constant is a class member which value can't be changed. Constant names should \nbe in uppercasing.\n\n__Example:__\n\n    var Calendar = $class({\n      MONTHS: 12,\n      WEEKS: 52,\n      DAYS: 365,\n    });\n\n#### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example:__\n\n    var Shape = $class({\n      __x: 0,\n      __y: 0\n    });\n\n#### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field.\n\n__Example__:\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n\n#### Static members\n\nStatic class members are used to create data and functions that can be accessed \nwithout creating an instance of the class. All static class members should be \nmust be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example:__\n\n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    });\n    \n    var result = Calculator.sum(2, 2);\n\n#### Inheritance\n\nInheritance is a way to reuse code and to establish a subtype from an existing \nobject. Constructor inheritance is also supported. To access parent's method, \nargument *$super* should be used. It must be the first argument in method definition.\n*$super* argument is optional.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n        this.__width = 0;\n        this.__height = 0;\n      },\n      width: {\n        get: function () {\n          return this.__width;\n        },\n        set: function (value) {\n          this.__width = value;\n        }\n      },\n      height: {\n        get: function () {\n          return this.__height;\n        },\n        set: function (value) {\n          this.__height = value;\n        }\n      },\n      draw: function ($super) {\n        $super.draw();\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \n          + \") at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, Shape);\n    \n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\n    shape.draw();\n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated. Abstract classes are declared by using the keyword \n__$abstract_class__.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = 'Component';\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = 'Button1';\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members. \nAbstract classes are declared by using the keyword __$static_class__.\n\n    $static_class(properties:Object): Object\n\n__Example:__\n\n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n\n### Enum\n\n__$enum__ keyword can be used to set up collections of named integer constants.\n\n    $enum(fields:Object): Object\n\n__Example:__\n\n    var Priority = $enum({\n      LOW: 0,\n      NORMAL: 1,\n      HIGH: 2\n    });\n\n### Interface\n\nInterfaces form a contract between the class and the outside world. If your class \nclaims to implement an interface, all methods defined by that interface must \nappear in its source code. Interfaces are declared by using the keyword __$interface__.\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatible with given interface or inherit given class.\n\n    $is(source:Object, target:Object): Boolean \n\nA class can inherit one or more interfaces.\n\n__Example:__\n\n    var IComponent = $interface({ \n      name: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__name = 'Shape';\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, IDrawable);\n    \n    var shape = new Shape();\n    \n    console.log($is(shape, IDrawable));\n\n### Object factory\n\nObject can be created by given type and initialized from anonymous object. To \naccomplish such task keyword __$create__ is used.\n\n    $create(type:Function, options:Object): Object\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var Layer = $class({\n      __construct__: function () {\n        this.__shapes = [];\n      },\n      add: function (options) {\n        this.__shapes.push($create(Shape, options));\n      }\n    });\n    \n    var layer = new Layer();\n    layer.add({ x: 10, y: 10 });\n\nAll properties from anonymous object can be copied to existing object. To \naccomplish such task keyword __$init__ is used.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape();\n    $init(shape, { x: 10, y: 10 });\n\n### Module\n\nModules were included to __class4js__ for better compatability with browsers.\nBrowsers don't have a built in module system. In Node.js modules are based\non internal module loading. Modules are declared by using the keyword __$module__.\n\n    $module(scope:Function, dependencies:Array): Object\n\n__Example:__\n\n    $config({\n      debug: true,\n      modules: [{\n        name: 'a',\n        path: './a.js'\n      }]\n    });\n\n    var external_module = {};\n    \n    var util = $module(function (fs, a, em, exports, global) {\n      var Reader = $class({\n        __construct__: function () {\n        },  \n        read: function () {\n          console.log(\"Reading...\");  \n        }  \n      }); \n      exports.Reader = Reader;\n    }, ['fs', 'a', external_module]);\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Namespace\n\nNamespaces are declared using the keyword __$namespace__.\n\n    $namespace(name:String): void\n\n__Example:__\n\n    $namespace('org.myapp.util');\n    \n    org.myapp.util = (function () {\n      var util = {};\n      return util;\n    }());\n    \n    console.log(org);\n\n### Extension\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    $extend(target:Object, name:String, value:Function): void\n\n__Example:__\n\n    var ICollection = $interface({\n      items: function() {\n      }\n    });\n    \n    var Collection = $class({\n      __construct__: function (items) {\n        this.__items = items;\n      },\n      items: function () {\n        return this.__items;\n      }\n    }, ICollection);\n    \n    $extend(ICollection, 'forEach', function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","readmeFilename":"readme.md","_id":"class4js@1.10.1","dist":{"shasum":"1d6396f70a131fb9225b129c152fa98843b7a8dc","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.10.1.tgz","integrity":"sha512-H8WH9OJqmeaxrLL6mJ5NApdhZNrXHi9w/PDBx6ADRN7PhOuW57OMgDqnYVSsp5X7UvcS9cd8dCbJiyK7PV1pQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2MklWFfnkn3wbA8caPwqAjXO4mjVkVCT3/+O247wLPAiEAhgjxBehULcAmeIYGY+6GyfRV45nb6EceIN7mA8PGD3A="}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.10.2":{"name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","version":"1.10.2","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\n[http://www.class4js.com](http://www.class4js.com)\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * Node.js\n  * Web Browser\n  * PhantomJS\n* API\n  * Class\n      * Constructor\n      * Static Constructor\n      * Object initializer\n      * Constant\n      * Fields\n      * Properties\n      * Static Members\n      * Inheritance\n  * Abstract Class\n  * Static Class\n  * Enum\n  * Interface \n  * Object Factory\n  * Modules\n  * Namespace\n  * Extensions\n* License\n\n## Installation\n\n### Node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n### Web Browser\n\nTo use __class4js__ module in web browser, simply download newest minified \n__class4js__ module file and include it to your browsers. You can also define \nmain module of application:\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\n    </head>\n    <body>\n      <!-- Your code goes here... -->\n    </body>\n    </html>\n\n### PhantomJS\n\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \nPhantomJS executor and include __class4js__ module's loading statement to main \nmodule:\n\n    'use strict';\n    \n    require('./class4js.js');\n    \n    // Your code goes here...\n\n### NuGet\n\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \ninstall class4js, run the following command in the package manager console.\n\n    Install-Package class4js\n\n## API\n\n### Class\n\nA class is a construct that is used to create instances of itself. A class defines \nconstituent members which enable its instances to have state and behavior. \nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \ndeclared by using the keyword __$class__:\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();   \n\n#### Constructor\n\nWhenever a class is created, its constructor is called. Name for a constructor \nis *\\_\\_construct\\_\\_*.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        // Your code goes here...\n      }\n    });\n\n#### Static Constructor\n\nStatic constructor is a static data initializer. Static constructors are called \nwhen the class is defined. Name for a static constructor is the same as ordinal \nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example__:\n\n    var Shape = $class({\n      __static__: {\n        __construct__: function () {\n          // Your code goes here...\n        }\n      }\n    });\n\n#### Object Initializer\n\nObject can be initialized with anonymous object. All properties from anonymous \nobject are copied to the target object.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n\n#### Constant\n\nA constant is a class member which value can't be changed. Constant names should \nbe in uppercasing.\n\n__Example:__\n\n    var Calendar = $class({\n      MONTHS: 12,\n      WEEKS: 52,\n      DAYS: 365,\n    });\n\n#### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example:__\n\n    var Shape = $class({\n      __x: 0,\n      __y: 0\n    });\n\n#### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field.\n\n__Example__:\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n\n#### Static members\n\nStatic class members are used to create data and functions that can be accessed \nwithout creating an instance of the class. All static class members should be \nmust be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example:__\n\n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    });\n    \n    var result = Calculator.sum(2, 2);\n\n#### Inheritance\n\nInheritance is a way to reuse code and to establish a subtype from an existing \nobject. Constructor inheritance is also supported. To access parent's method, \nargument *$super* should be used. It must be the first argument in method definition.\n*$super* argument is optional.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n        this.__width = 0;\n        this.__height = 0;\n      },\n      width: {\n        get: function () {\n          return this.__width;\n        },\n        set: function (value) {\n          this.__width = value;\n        }\n      },\n      height: {\n        get: function () {\n          return this.__height;\n        },\n        set: function (value) {\n          this.__height = value;\n        }\n      },\n      draw: function ($super) {\n        $super.draw();\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \n          + \") at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, Shape);\n    \n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\n    shape.draw();\n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated. Abstract classes are declared by using the keyword \n__$abstract_class__.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = 'Component';\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = 'Button1';\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members. \nAbstract classes are declared by using the keyword __$static_class__.\n\n    $static_class(properties:Object): Object\n\n__Example:__\n\n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n\n### Enum\n\n__$enum__ keyword can be used to set up collections of named integer constants.\n\n    $enum(fields:Object): Object\n\n__Example:__\n\n    var Priority = $enum({\n      LOW: 0,\n      NORMAL: 1,\n      HIGH: 2\n    });\n\n### Interface\n\nInterfaces form a contract between the class and the outside world. If your class \nclaims to implement an interface, all methods defined by that interface must \nappear in its source code. Interfaces are declared by using the keyword __$interface__.\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatible with given interface or inherit given class.\n\n    $is(source:Object, target:Object): Boolean \n\nA class can inherit one or more interfaces.\n\n__Example:__\n\n    var IComponent = $interface({ \n      name: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__name = 'Shape';\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, IDrawable);\n    \n    var shape = new Shape();\n    \n    console.log($is(shape, IDrawable));\n\n### Object factory\n\nObject can be created by given type and initialized from anonymous object. To \naccomplish such task keyword __$create__ is used.\n\n    $create(type:Function, options:Object): Object\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var Layer = $class({\n      __construct__: function () {\n        this.__shapes = [];\n      },\n      add: function (options) {\n        this.__shapes.push($create(Shape, options));\n      }\n    });\n    \n    var layer = new Layer();\n    layer.add({ x: 10, y: 10 });\n\nAll properties from anonymous object can be copied to existing object. To \naccomplish such task keyword __$init__ is used.\n\n    $init(target:Object, options:Object): void\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape();\n    $init(shape, { x: 10, y: 10 });\n\n### Module\n\nModules were included to __class4js__ for better compatability with browsers.\nBrowsers don't have a built in module system. In Node.js modules are based\non internal module loading. Modules are declared by using the keyword __$module__.\n\n    $module(scope:Function, dependencies:Array): Object\n\n__Example:__\n\n    $config({\n      debug: true,\n      modules: [{\n        name: 'a',\n        path: './a.js'\n      }]\n    });\n\n    var external_module = {};\n    \n    var util = $module(function (fs, a, em, exports, global) {\n      var Reader = $class({\n        __construct__: function () {\n        },  \n        read: function () {\n          console.log(\"Reading...\");  \n        }  \n      }); \n      exports.Reader = Reader;\n    }, ['fs', 'a', external_module]);\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Namespace\n\nNamespaces are declared using the keyword __$namespace__. Namespaces help avoid \nnaming collisions or excessive name prefixing.\n\n    $namespace(name:String): void\n\n__Example:__\n\n    $namespace('org.myapp.util');\n    \n    org.myapp.util = (function () {\n      var util = {};\n      return util;\n    }());\n\nNamespaces can be used within modules.\n\n__Example:__\n\n    var myapp = $module(function () {\n\n    $namespace('visual.shared');\n\n      visual.shared.Element = $class({\n        // Code goes here....\n      });\n\n    });\n\n    (function () {\n\n      // In other scope local variable, which will point to the desired \n      // class, can be created \n      \n      var Element = myapp.visual.shared.Element;\n\n    }); \n\n### Extension\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    $extend(target:Object, name:String, value:Function): void\n\n__Example:__\n\n    var ICollection = $interface({\n      items: function() {\n      }\n    });\n    \n    var Collection = $class({\n      __construct__: function (items) {\n        this.__items = items;\n      },\n      items: function () {\n        return this.__items;\n      }\n    }, ICollection);\n    \n    $extend(ICollection, 'forEach', function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","readmeFilename":"readme.md","_id":"class4js@1.10.2","dist":{"shasum":"927480736bfba744ebfbe4bb411de0384de6f8b8","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.10.2.tgz","integrity":"sha512-OeNwt2MjFiCOu/RBn99NNqVVcmXV88BAeL++X5cYLoz+qN0YYJXwoDcW6NsmRB1O2QyjQYyRtRl7GryJ2zPtKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDGjP4bVdP+UONPKQ/JeN8Rn1ml07ONwFfbHJYrKfTAbAiBP0qhQ68o0EAm9+5XvNi21CBbK48uBa7Ettzc4DZGhHw=="}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"},"1.10.3":{"name":"class4js","description":"The class4js module is for class-driven development in JavaScript. It allows to emulate classes in JavaScript. Module is based on ECMAScript 5 standart and implements open/close principle: 'A module should be open for extension but closed for modifications'","version":"1.10.3","homepage":"http://www.class4js.com","author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"bugs":{"url":"https://github.com/gedbac/class4js/issues"},"keywords":["class","abstract","interface","inheritance","super","constant","static","browser","prototype","extensions","namespace","phantomjs","module","javascript","enum","property","field","constructor","static class","abstract class","object initializer"],"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"main":"./lib/class4js.js","engines":{"node":">=0.8.8"},"readme":"# class4js\n\n[http://www.class4js.com](http://www.class4js.com)\n\nThe __class4js__ module is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Module based on ECMAScript 5 standart and \nimplements open/close principle:  _\"When class is created, class is closed for \nmodifications\"_. __class4js__  is free software distributed under the terms of \nthe _GNU General Public License version 3_ and can be used with __node.js__, \n__modern web browsers__ and even with __PhantomJS__.\n\n    // Simple class example:\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();\n    \n    // Output:\n    // Drawing shape at: (120, 85)\n\n## Overview\n\n* Installation\n  * Node.js\n  * Web Browser\n  * PhantomJS\n* API\n  * Class\n      * Constructor\n      * Static Constructor\n      * Object initializer\n      * Constant\n      * Fields\n      * Properties\n      * Static Members\n      * Inheritance\n  * Abstract Class\n  * Static Class\n  * Enum\n  * Interface \n  * Object Factory\n  * Modules\n  * Namespace\n  * Extensions\n* License\n\n## Installation\n\n### Node.js\n\nTo install __class4js__ module for node.js, this command should be used:\n\n    npm install class4js\n\nAlso __class4js__ module's loading statement should be added to main module:\n\n    'use strict';\n    \n    require('class4js');\n    \n    // Your code goes here...\n\n### Web Browser\n\nTo use __class4js__ module in web browser, simply download newest minified \n__class4js__ module file and include it to your browsers. You can also define \nmain module of application:\n\n    <!DOCTYPE HTML>\n    <html>\n    <head>\n      <script src=\"./scripts/class4js.min.js\" data-main=\"./scripts/main.js\"></script>\n    </head>\n    <body>\n      <!-- Your code goes here... -->\n    </body>\n    </html>\n\n### PhantomJS\n\nTo use __class4js__ in with PhantomJS, simply copy __class4js__ module near \nPhantomJS executor and include __class4js__ module's loading statement to main \nmodule:\n\n    'use strict';\n    \n    require('./class4js.js');\n    \n    // Your code goes here...\n\n### NuGet\n\nIn Visual Studio __class4js__ module can be installed using NuGet extension. To \ninstall class4js, run the following command in the package manager console.\n\n    Install-Package class4js\n\n## API\n\n### Class\n\nA class is a construct that is used to create instances of itself. A class defines \nconstituent members which enable its instances to have state and behavior. \nPrivate class members are decorated with \\_\\_ and protected with \\_. Classes are \ndeclared by using the keyword __$class__:\n\n    $class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }, \n      moveTo: function (x, y) {\n        this.x = x;\n        this.y = y;\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n    shape.moveTo(120, 85);\n    shape.draw();   \n\n#### Constructor\n\nWhenever a class is created, its constructor is called. Name for a constructor \nis *\\_\\_construct\\_\\_*.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        // Your code goes here...\n      }\n    });\n\n#### Static Constructor\n\nStatic constructor is a static data initializer. Static constructors are called \nwhen the class is defined. Name for a static constructor is the same as ordinal \nconstructor name, but must be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example__:\n\n    var Shape = $class({\n      __static__: {\n        __construct__: function () {\n          // Your code goes here...\n        }\n      }\n    });\n\n#### Object Initializer\n\nObject can be initialized with anonymous object. All properties from anonymous \nobject are copied to the target object.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape({ x: 100, y: 100 });\n\n#### Constant\n\nA constant is a class member which value can't be changed. Constant names should \nbe in uppercasing.\n\n__Example:__\n\n    var Calendar = $class({\n      MONTHS: 12,\n      WEEKS: 52,\n      DAYS: 365,\n    });\n\n#### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example:__\n\n    var Shape = $class({\n      __x: 0,\n      __y: 0\n    });\n\n#### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field.\n\n__Example__:\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n\n#### Static members\n\nStatic class members are used to create data and functions that can be accessed \nwithout creating an instance of the class. All static class members should be \nmust be surrounded by *\\_\\_static\\_\\_* statement.\n\n__Example:__\n\n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    });\n    \n    var result = Calculator.sum(2, 2);\n\n#### Inheritance\n\nInheritance is a way to reuse code and to establish a subtype from an existing \nobject. Constructor inheritance is also supported. To access parent's method, \nargument *$super* should be used. It must be the first argument in method definition.\n*$super* argument is optional.\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n        this.__width = 0;\n        this.__height = 0;\n      },\n      width: {\n        get: function () {\n          return this.__width;\n        },\n        set: function (value) {\n          this.__width = value;\n        }\n      },\n      height: {\n        get: function () {\n          return this.__height;\n        },\n        set: function (value) {\n          this.__height = value;\n        }\n      },\n      draw: function ($super) {\n        $super.draw();\n        console.log(\"Drawing rectangle (\" + this.width + \", \" + this.height \n          + \") at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, Shape);\n    \n    var shape = new Shape({ x: 100, y: 100, with: 50, height: 50 });\n    shape.draw();\n\n### Abstract Class\n\nAbstract class is intended only to be a base class of other classes. Abstract \nclass can't be  instantiated. Abstract classes are declared by using the keyword \n__$abstract_class__.\n\n    $abstract_class(properties:Object, parent:Object, interfaces:Array): Function\n\n__Example:__\n\n    var Component = $abstract_class({\n      __construct__: function () { \n        this.__name = 'Component';\n      },\n      name: { \n        get: function () { \n          return this.__name; \n        },\n        set: function (value) { \n          this.__name = value; \n        }\n      }\n    }); \n    \n    var Button = $class({\n      __construct__: function () {\n        this.name = 'Button1';\n      }\n    }, Component)\n    \n    try {\n      var component = new Component(); \n    } catch (ex) {\n      console.log(ex.message);\n    } \n    \n    var button = new Button();\n\n### Static Class\n\nStatic class can't be initialized or inherited and contains only static members. \nAbstract classes are declared by using the keyword __$static_class__.\n\n    $static_class(properties:Object): Object\n\n__Example:__\n\n    var Counter = $static_class({\n      __construct__: function () {\n        this.__value = 0;\n      },\n      increment: function () {\n        this.__value++;\n      },\n      current: {\n        get: function () {\n          return this.__value;\n        }\n      }\n    });\n    \n    Counter.increment();\n\n### Enum\n\n__$enum__ keyword can be used to set up collections of named integer constants.\n\n    $enum(fields:Object): Object\n\n__Example:__\n\n    var Priority = $enum({\n      LOW: 0,\n      NORMAL: 1,\n      HIGH: 2\n    });\n\n### Interface\n\nInterfaces form a contract between the class and the outside world. If your class \nclaims to implement an interface, all methods defined by that interface must \nappear in its source code. Interfaces are declared by using the keyword __$interface__.\n\n    $interface(properties:Object, parent:Object): Object\n\nYou can check if object is compatible with given interface or inherit given class.\n\n    $is(source:Object, target:Object): Boolean \n\nA class can inherit one or more interfaces.\n\n__Example:__\n\n    var IComponent = $interface({ \n      name: {\n        get: function () {}\n      }\n    });\n    \n    var IDrawable = $interface({\n      draw: function (context) {} \n    }, IComponent);\n    \n    var Shape = $class({\n      __construct__: function () {\n        this.__name = 'Shape';\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        }\n      },\n      draw: function () {\n        console.log(\"Drawing shape at: (\" + this.x + \", \" + this.y + \")\");\n      }\n    }, IDrawable);\n    \n    var shape = new Shape();\n    \n    console.log($is(shape, IDrawable));\n\n### Object factory\n\nObject can be created by given type and initialized from anonymous object. To \naccomplish such task keyword __$create__ is used.\n\n    $create(type:Function, options:Object): Object\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var Layer = $class({\n      __construct__: function () {\n        this.__shapes = [];\n      },\n      add: function (options) {\n        this.__shapes.push($create(Shape, options));\n      }\n    });\n    \n    var layer = new Layer();\n    layer.add({ x: 10, y: 10 });\n\nAll properties from anonymous object can be copied to existing object. To \naccomplish such task keyword __$init__ is used.\n\n    $init(target:Object, options:Object): void\n\n__Example:__\n\n    var Shape = $class({\n      __construct__: function () {\n        this.__x = 0;\n        this.__y = 0;\n      },\n      x: {\n        get: function () {\n          return this.__x;\n        },\n        set: function (value) {\n          this.__x = value;\n        }\n      },\n      y: {\n        get: function () {\n          return this.__y;\n        },\n        set: function (value) {\n          this.__y = value;\n        }\n      }\n    });\n    \n    var shape = new Shape();\n    $init(shape, { x: 10, y: 10 });\n\n### Module\n\nModules were included to __class4js__ for better compatability with browsers.\nBrowsers don't have a built in module system. In Node.js modules are based\non internal module loading. Modules are declared by using the keyword __$module__.\n\n    $module(scope:Function, dependencies:Array): Object\n\n__Example:__\n\n    $config({\n      debug: true,\n      modules: [{\n        name: 'a',\n        path: './a.js'\n      }]\n    });\n\n    var external_module = {};\n    \n    var util = $module(function (fs, a, em, exports, global) {\n      var Reader = $class({\n        __construct__: function () {\n        },  \n        read: function () {\n          console.log(\"Reading...\");  \n        }  \n      }); \n      exports.Reader = Reader;\n    }, ['fs', 'a', external_module]);\n    \n    var reader = new util.Reader();\n    reader.read();\n\n### Namespace\n\nNamespaces are declared using the keyword __$namespace__. Namespaces help avoid \nnaming collisions or excessive name prefixing.\n\n    $namespace(name:String, items:Object): void\n\n__Example:__\n\n    $namespace('org.myapp.util');\n    \n    org.myapp.util = (function () {\n      var util = {};\n      return util;\n    }());\n\nNamespaces can be used within modules.\n\n__Example:__\n\n    var myapp = $module(function (myapp) {\n\n      $namespace('myapp.visual.common');\n\n      myapp.visual.common.Button = $class({\n        // Code goes here....\n      });\n\n    });\n\nAlso class can be used within namespace.\n\n__Example:__\n\n    $namespace('myapp.visual', {\n      Shape: $class({\n        __construct__: function () {\n\n        },\n        draw: function () {\n\n        }\n      })\n    });\n\n### Extension\n\nExtensions enables you to add methods to existing types without creating a new \nderived type.\n\n    $extend(target:Object, name:String, value:Function): void\n\n__Example:__\n\n    var ICollection = $interface({\n      items: function() {\n      }\n    });\n    \n    var Collection = $class({\n      __construct__: function (items) {\n        this.__items = items;\n      },\n      items: function () {\n        return this.__items;\n      }\n    }, ICollection);\n    \n    $extend(ICollection, 'forEach', function (callback) {\n      if (callback) {\n        for (var i = 0; i < this.items().length; i++) {\n          callback(this.items()[i]);\n        } \n      } \n    });\n    \n    var collection = new Collection([1, 2, 3]);\n    collection.forEach(function (item) {\n      console.log(item);\n    });\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","readmeFilename":"readme.md","_id":"class4js@1.10.3","dist":{"shasum":"32b3906f2bf3c64a92f1d5ef02f77b6471334c93","tarball":"https://registry.npmjs.org/class4js/-/class4js-1.10.3.tgz","integrity":"sha512-kCar9XgbHaIbo4Ev4cG0ELJiAcyLEf/ivYZJVIzBJuFRa4H8mE1ltH95h+PTweGnhg2LV+2lonEaqCmREhGPNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHO0Upce/HZVny4SlyUk7zCrnZyLUyFS99NmtEZvlR6lAiBMNvGR0BHJOHlmVPOZaf99B+mnnNaq09K9V5tedRpI0g=="}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"gedbac","email":"gediminas.backevicius@gmail.com"},"maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"directories":{},"deprecated":"This pacakge outadated"}},"readme":"# class4js\n\nThe __class4js__ library is for class-driven development in JavaScript. It \nallows to emulate classes in JavaScript. Library based on ECMAScript 5 API and \nimplements _open/close principle_. When class is created, class is closed for \nmodifications.\n\n__The Open/Close principle__\n\n    A module should be open for extension but closed for modifications.\n\n## Installation\n\n    npm install class4js\n\n## API\n\nPrivate class members are decorated with __ and protected with _.\n\n### Create class\n\nCreates a class: \n\n    class4js.Class.create(properties:Object, parent:Object): Object\n\nor\n\n    $class(properties:Object, parent:Object): Object\n\n__Example__\n\n    \"use strict\";\n\n    require(\"class4js\");\n\n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      }\n    });\n\n    var person = new Person(\"John Smith\");\n\n    console.log(person.getName());    \n\n### Fields\n\nAll class fields should be defined as class members or initialized in constructor, \nbecause when class is created, class is closed for modifications.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n        __age: 30,\n        __construct__: function (name) {\n        this.__name = name;\n      },\n      getName: function () {\n        return this.__name;\n      },\n      getAge: function () {\n        return this.__age;\n      },\n      setGender: function (gender) {\n        // It's to late to initialize a class field:\n        this.__gender = gender;\n      }\n    });\n    \n    var person = new Person(\"John Smith\");\n    \n    console.log(person.getName());\n    console.log(person.getAge());\n    \n    // Error will be raised here:\n    person.setGender(\"male\");\n\n### Constants\n\nUse NAMES_LIKE_THIS for constants.\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      MAX_AGE: 99,\n      __construct__: function () {\n      }\n    });\n    \n    console.log(Person.MAX_AGE);\n\n### Properties\n\nA property is a member that provides a flexible mechanism to read, write, or \ncompute the value of a private field:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Person = $class({\n      __construct__: function (name) {\n        this.__name = name;\n        this.__created = new Date();\n      },\n      name: {\n        get: function () {\n          return this.__name;\n        },\n        set: function (value) {\n          this.__name = value;\n        }\n      },\n      created: {\n        get: function () {\n          return this.__created;\n        }\n      }\n    });\n    \n    var person = new Person();\n    person.name = \"John Smith\";\n    \n    console.log(person.name);\n    console.log(person.created); \n\n### Static members\n\nclass4js library allows to define static class members:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Calculator = $class({\n      __static__: {\n        sum: function (a, b) {\n          return a + b;\n        },\n        subtract: function (a, b) {\n          return a - b;\n        }\n      }\n    }); \n    \n    console.log(Calculator.sum(2, 2));\n    console.log(Calculator.subtract(8, 4));\n\n### Inheritance\n\nCreates a class with the specified parent:\n\n__Example__\n\n    \"use strict\";\n    \n    require(\"class4js\");\n    \n    var Shape = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        console.log(\"Shape is drawn...\");\n      }\n    });\n    \n    var Rectangle = $class({\n      __construct__: function () {\n      },\n      draw: function () {\n        this._super.draw();\n        console.log(\"Rectangle is drawn...\");\n      }\n    }, Shape); \n    \n    var rec = new Rectangle();\n    rec.draw();\n\n## License\n\nThis software is distributed under the terms of the GNU General Public License, \nversion 3 (GPL-3.0).\n","maintainers":[{"name":"gedbac","email":"gediminas.backevicius@gmail.com"}],"time":{"modified":"2022-06-13T06:05:55.673Z","created":"2012-08-31T18:24:35.997Z","1.0.0":"2012-08-31T18:24:53.310Z","1.1.0":"2012-09-08T07:19:21.825Z","1.1.1":"2012-09-09T07:05:57.384Z","1.2.0":"2012-09-15T06:58:14.507Z","1.2.1":"2012-09-15T09:35:07.520Z","1.3.0":"2012-10-06T19:09:33.424Z","1.4.0":"2012-10-09T18:37:32.714Z","1.4.1":"2012-10-10T19:12:14.870Z","1.4.2":"2012-10-11T19:22:00.814Z","1.4.3":"2012-10-12T18:08:24.376Z","1.4.4":"2012-10-16T19:22:50.032Z","1.5.0":"2012-12-09T18:43:59.979Z","1.6.0":"2012-12-09T20:43:17.684Z","1.6.1":"2012-12-14T20:24:34.117Z","1.6.2":"2012-12-16T17:58:49.620Z","1.6.3":"2012-12-17T20:04:19.172Z","1.6.4":"2012-12-21T20:00:20.165Z","1.7.0":"2012-12-22T14:51:14.638Z","1.7.1":"2012-12-24T20:03:01.592Z","1.8.0":"2013-01-09T17:52:14.467Z","1.9.0":"2013-02-14T20:28:18.191Z","1.9.1":"2013-03-19T14:13:33.524Z","1.9.2":"2013-03-27T19:44:45.903Z","1.10.0":"2013-06-03T06:54:23.960Z","1.10.1":"2013-06-03T08:11:12.920Z","1.10.2":"2013-06-10T08:30:52.241Z","1.10.3":"2013-08-02T10:53:33.836Z"},"author":{"name":"Gediminas Backevicius","email":"gediminas.backevicius@gmail.com"},"repository":{"type":"git","url":"https://github.com/gedbac/class4js.git"},"users":{"gedbac":true}}