Numeric Production Mechanism
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

protosaurus

1.0.0 • Public • Published

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');
 
var A = Protosaurus.extend({
    constructor(name) {
        this.name = name;
    },
    greet() {
        return `Hello ${this.name}`;
    }
});
 
var 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"

Install

npm i protosaurus

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar