Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanwimmer128/class-helper
ClassHelper helps creating classes easily
https://github.com/stefanwimmer128/class-helper
Last synced: 2 days ago
JSON representation
ClassHelper helps creating classes easily
- Host: GitHub
- URL: https://github.com/stefanwimmer128/class-helper
- Owner: stefanwimmer128
- License: isc
- Created: 2016-07-08T11:45:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-10T08:41:34.000Z (over 8 years ago)
- Last Synced: 2024-12-10T00:29:47.825Z (29 days ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ClassHelper
ClassHelper helps creating classes easily
## How to use
ClassHelper can be used either as node module or bower component.
### Using npm
``` bash
npm i -S class-helper
`````` javascript
const ClassHelper = require("class-helper");
```### Using bower
``` bash
bower i -S class-helper
`````` html
```
### Start coding
``` javascript
const Logger = ClassHelper.Factory({
log: function (...message)
{
console.log(...message);
}
});const Greet = ClassHelper.Bound("greet", function ()
{
this.log("Hello " + this.getName());
});const Person = ClassHelper({
constructor: function (_super, name)
{
this.name = name;
},
getName: function ()
{
return this.name;
}
}, [ Logger ], [ Greet ]);const Me = ClassHelper({
constructor: function (_super)
{
_super("stefanwimmer128");
}
}, Person);new Me().greet(); // Hello stefanwimmer128
```