1.0.2 • Published 3 years ago

class-build v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

class-build

This module helps you create a class that is more customizable than provided natively. This provides class extension, get overload, set overload, and private stuffs. In every class made by this, privates are provided Privates are in different object, so it wont collide with public properties.

Quickstart

const ClassBuilder = require('class-build');

const PersonBuilder = new ClassBuilder({ // Invoking with 'new' is optional
    name: 'Person,
    nonew: false,
    extends: null
}, function(privates, name) {
    // Constructor
    privates.name = name.toString();
}); 

PersonBuilder.public('getName', function(privates) {
    return privates.name;
})

const Person = PersonBuilder.build();

let Kode = new Person('Kode');

console.log(Kode.getName());

Documentation

Please see this link. Sorry for the bad documentation.

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago