get ini file with node js

Solutions on MaxInterview for get ini file with node js by the best coders in the world

showing results for - "get ini file with node js"
Christina
02 Jan 2020
1var fs = require('fs')
2  , ini = require('ini')
3
4var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))
5
6config.scope = 'local'
7config.database.database = 'use_another_database'
8config.paths.default.tmpdir = '/tmp'
9delete config.paths.default.datadir
10config.paths.default.array.push('fourth value')
11
12fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))
13