Socket
Book a DemoInstallSign in
Socket

class-helper

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-helper

ClassHelper helps creating classes easily

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ClassHelper

ClassHelper helps creating classes easily

How to use

ClassHelper can be used either as node module or bower component.

Using npm

npm i -S class-helper
const ClassHelper = require("class-helper");

Using bower

bower i -S class-helper
<script src="bower_components/class-helper/build/class-helper.js"></script>

Start coding

const Logger = ClassHelper.Factory({
    log: function (...message)
    {
        console.log(...message);
    }
});

const Greet = ClassHelper.Bound("greet", function ()
{
    this.log("Hello " + this.getName());
});

const Person = ClassHelper({
    constructor: function (_super, name)
    {
        this.name = name;
    },
    
    getName: function ()
    {
        return this.name;
    }
}, [ Logger ], [ Greet ]);

const Me = ClassHelper({
    constructor: function (_super)
    {
        _super("stefanwimmer128");
    }
}, Person);

new Me().greet(); // Hello stefanwimmer128

Keywords

class-helper

FAQs

Package last updated on 10 Jul 2016

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.