0.1.7 • Published 8 years ago

classprivates v0.1.7

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

classprivates

© Ironboy 2017, MIT licensed

What does it do?

Makes all class members (properties, methods, getters and setters) with a certain prefix (default is "_") private.

How?

Firstly define a class

class ClassName(){
  // whatever methods, setters and getters
}

Then make members private

var classprivates = require('classprivates');
ClassName = classprivates(ClassName,[prefixString]);

This makes all properties, methods, getters and setters with a certain prefix (default is "_") private - that is non-reachable from outside the code in the class.

Lastly (and optionally)

Just if you are making a module from your class:

module.exports = ClassName;
0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago