mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* Convert all JSON configurations (*.json) to HJSON (*.hjson) which is much more flexible for a human readable and editable configuration format
* WIP "next" vs "action" changes * options.cls is now defaulted in config.js/config.hjson (default = true) * Notes/etc.
This commit is contained in:
parent
052cf5c490
commit
ca4b99a83e
10 changed files with 163 additions and 108 deletions
|
@ -9,6 +9,7 @@ var fs = require('fs');
|
|||
var Gaze = require('gaze').Gaze;
|
||||
var stripJsonComments = require('strip-json-comments');
|
||||
var assert = require('assert');
|
||||
var hjson = require('hjson');
|
||||
|
||||
module.exports = exports = new JSONCache();
|
||||
|
||||
|
@ -21,9 +22,11 @@ function JSONCache() {
|
|||
this.reCacheJSONFromFile = function(filePath, cb) {
|
||||
fs.readFile(filePath, { encoding : 'utf-8' }, function fileRead(err, data) {
|
||||
try {
|
||||
self.cache[filePath] = JSON.parse(stripJsonComments(data));
|
||||
//self.cache[filePath] = JSON.parse(stripJsonComments(data));
|
||||
self.cache[filePath] = hjson.parse(data);
|
||||
cb(null, self.cache[filePath]);
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
cb(e);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue