.ini file:
. ini文件:
[1]
10X=true
[2]
10X=true
node.js :
节点。js:
var mS = ini.parse(fs.readFileSync(__dirname + '/XXX/MS.ini', 'utf-8'));
console.log(mS.1.10X);
I am using : var ini = require('ini');
module's link here : https://www.npmjs.org/package/ini
My .ini files variable names start with number so node.js give me an error :
我正在使用:var ini = require('ini');这里模块的链接:https://www.npmjs.org/package/ini我的。ini文件变量名以number so node开头。js给我一个错误:
I have too many logs in .ini file, so i can not change variable names.
Are there any way to fix it?
我在.ini文件中有太多的日志,所以不能更改变量名。有办法解决吗?
1 个解决方案
#1
0
I guess you need to use this syntax
我想你需要使用这种语法
console.log(mS[1]['10X']);
#1
0
I guess you need to use this syntax
我想你需要使用这种语法
console.log(mS[1]['10X']);