JSPM

protosaurus

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12407F
  • License MIT

Descriptive native js class creator

Package Exports

  • protosaurus

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (protosaurus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

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"