node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

private-accessor

private

Private variables for javascript

npm install --save private-accessor

Example Usage

var $private = require('private-accessor').createAccessor();
 
var foo = {bar: '3'};
$private(foo).secret = 3;
 
console.log(foo);
// { bar: '3' } 
 
console.log($private(foo));
// { secret: 3 }