readonly
readonly is simple reference restriction library between custom modules in node object.
How to install
npm install readonly
How to use
var readonly = ; var obj = 'A':'a''B':'b''C':'c'; // Normal ACL. You can use `obj` through moduleA as you likevar moduleA = {};moduleAobj = obj; // Readonly restriction of `obj` in moduleBvar moduleB = {};moduleBobj = ; // You can update `obj` from moduleAmoduleAobjA = "d";// This updates can be seen from moduleBconsole; // --> "d" // But if you update `obj` through moduleB, it will throws `UnableRewriteException`moduleAobjB = "e"; // --> UnableRewriteException: original cannot be rewrite
LICENSE
MIT License. Please see the LICENSE file for details.