Skip to content

wormggmm/gs-json-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gs-json-loader

Load all Json file in a dir which file by end of .json .Json .JSON. Support node version: 8.11.1/8.11.1+ need node support await/async e.g. workSpace:

testConfig
|--testDir1
|----testConfig1.json
|--testConfig2.json

Code:

Usage Async

const JsonLoader = require("gs-json-loader");

let config1 = new JsonLoader("./testConfig");
await config1.load();
console.log("getValue:", config1._.testDir1.testConfig1.testkey1)

Usage Sync

const JsonLoader = require("gs-json-loader");

let config1 = new JsonLoader("./testConfig");
config1.loadSync();
console.log("getValue:", config1._.testDir1.testConfig1.testkey1)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published