Skip to content

Yet another class system for JS based on a ES2015 features

Notifications You must be signed in to change notification settings

rumkin/protosaurus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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"

About

Yet another class system for JS based on a ES2015 features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published