Skip to content

windyrobin/HotCfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

json files auto load when the content changes

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors