read-only
v0.1.2
Published
read-only
Downloads
5
Readme
read-only
Wrap an normal object to a read-only object, the same as its properties;
Install
$ npm install read-only --save
Usage
var readonly = require('read-only');
var ro = readonly({a: 1, b: { c: 'h'}});
ro.a = 2; // no change
consoe.log(ro.a); // 1
(function() {
"use strict";
ro.a = 2; // exception
})();
var b = ro.b;
b.c = 'r'; // no change
Licence
MIT