json files auto load when the content changes
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
README
Readme.md
cfgload.js
cfgtest.js

Readme.md

A auto-reload Json class

It supports file/diretory mode and you could use it like that :

var cfg = new Cfg("file.json");
var obj = cfg.get();

if you specify a directory and it has two files :

   dir/a.json
   dir/b.json

you could write code like that :

var cfg = new Cfg("dir");
var obja = cfg.get("a.json");
var objb = cfg.get("b.json");

####Note:

when you use directory mode ,it will auto-load when file add/detele/rename, but if you edit the exsting file, you should 'touch' the directory to trigger the change event to reload