An open API service indexing awesome lists of open source software.

https://github.com/rumkin/protosaurus

Yet another class system for JS based on a ES2015 features
https://github.com/rumkin/protosaurus

Last synced: 9 months ago
JSON representation

Yet another class system for JS based on a ES2015 features

Awesome Lists containing this project

README

          

# Protosaurus

Protosaurus in a basic proto object for custom class system. It's main feature
is support of ES2015 object syntax and customizable inheritance strategies based
on a new features of Symbol properties.

## Install

Install via npm:

```
npm i protosaurus
```

## Example

```javascript
const Protosaurus = require('protosaurus');

const A = Protosaurus.extend({
constructor(name) {
this.name = name;
},
greet() {
return `Hello ${this.name}`;
}
});

const B = A.extend({
greet() {
return `Hi ${this.name}`;
}
});

var a = new A('World');
var b = new B('World');

a.greet(); // => "Hello World"
b.greet(); // => "Hi World"
```