Socket
Socket
Sign inDemoInstall

@coffeekraken/s-class

Package Overview
Dependencies
3
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @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.


Version published
Maintainers
1
Created

Readme

Source

@coffeekraken/s-class

MIT 2.0.0-alpha.20 - Git repository

size downloads license discord

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); // {hello:'world'}
  }
}

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() {
    // etc...
  }
}

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:

discord email

FAQs

Last updated on 15 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc