fixed-object
Make an object immutable! Just that! No more crap!
install:
$ npm install fixed-object
make immutable:
config.json:
var fixedobj = ;var config = ; console; // => { name: 'gochomugo' } // this will throw an errorconfigname = "sheldon cooper"; // => TypeError: Cannot assign to read only property 'name' of #<Object> console; // => { name: 'gochomugo' }
how is it useful?
I find this useful when loading configuration files. We usually never intend to mutate configuration objects. But if you accidentally do, you can imagine the shit crap your application will go through before you realize where you messed up.
license:
The MIT License (MIT)
Copyright (c) 2015-2016 GochoMugo mugo@forfuture.co.ke