private-properties
v1.0.0
Published
Provides a way of storing private properties in objects
Downloads
9
Maintainers
Readme
private-properties
Provides a way of storing private properties in objects
npm i private-properties -S
const pp = require('private-properties');
// creates new key and returns a function
let _ = pp("MyClass-private")
class MyClass {
constructor() {
// returns a object
_(this).somePrivateStuff = "private";
}
}
privatePropterties
the function takes a string that acts as a description for the private key. It returns a function that can be used to retrieve the privat object.