@coffeekraken/s-class
Base class that can be (and is) used as base class for all your needs. It mainly expose the "settings" property which store your passed settings up from your class.
Install
npm i @coffeekraken/s-class
SClass
This package expose a simple SClass
class that you can use as base class for yours.
Features
- Provide a
settings
internal property to store the one passed in the constructor - Provide a
metas
property to store metas informations about the class - Provide a
toPlainObject
method to convert you class to json - And more...
Usage
How to start using it?
Here's a simple example of how to extends the SClass
class:
import __SClass from '@coffeekraken/s-class';
class MyClass extends __SClass {
constructor() {
super({
hello: 'world',
});
console.log(this.settings);
}
}
Alternatively, you can extend an existing class with the SClass
like so:
import __SClass from '@coffeekraken/s-class';
class MyPromise extends __SClass.extends(Promise) {
constructor() {
}
}
API
For more information about the API, please check out the API documentation
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Here's all the ways you can contact us listed: