JSPM

extends-classes

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15897
  • Score
    100M100P100Q140066F
  • License MIT

Extend from multiple classes!

Package Exports

  • extends-classes

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 (extends-classes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Extend Multiple Classes

Ever wanted to extend from multiple classes in Javascript? well now you can.

Usage

const classes = require('extends-classes');

class Test extends classes (A, B, C) {
}

Method missing:

const classes = require('extends-classes');

class Test extends classes (A, B, C) {
  constructor() {
    super();
  }

  __call(method, args) {
    console.log(`'${method}()' is missing!`);
  }
}

const test = new Test();

test.somethingThatIsNonExistent();
// 'somethingThatIsNonExistent()' is missing!

MethodMissing is included in the stack, see method-missing.

Check out the test folder for more!

Installation

$ npm install extends-classes

Features

  • Extend multiple es6 classes.
  • Simple and light-weight.
  • Includes MethodMissing.
  • Written in ES6+ for node.js 6+.
  • Clean solution to extending from multiple classes.

Options

If you don't like the naming, just change it when requiring.

const many = require('extends-classes');

class Test extends many (A, B, C) {
  // class stuff.
}

Tests

From the package

$ npm test

License

MIT