@bonnie/class

an object oriented javascript Inheritance framework

Usage no npm install needed!

<script type="module">
  import bonnieClass from 'https://cdn.skypack.dev/@bonnie/class';
</script>

README

an object oriented javascript Inheritance framework

  var Vehicle = Class.Create({
    init: function(wheels) {
      this.wheels = wheels;
    }
  });

  var Truck = Vehicle.Extend({
    init: function(hp, wheels) {
      this._super(wheels);
      this.horsepower = hp;
    },
    printInfo: function() {
      console.log('I am a truck and I have ' + this.wheels +
        ' wheels and ' + this.horsepower + ' hp.');
    }
  });
  
  var t = new Truck(350, 4);
  t.printInfo();