Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get ini file with node js

var fs = require('fs')
  , ini = require('ini')

var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))

config.scope = 'local'
config.database.database = 'use_another_database'
config.paths.default.tmpdir = '/tmp'
delete config.paths.default.datadir
config.paths.default.array.push('fourth value')

fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))
Comment

PREVIOUS NEXT
Code Example
Javascript :: networkx check if node exists 
Javascript :: Find the next perfect square! 
Javascript :: print page using js 
Javascript :: classlist 
Javascript :: create react without jsx 
Javascript :: useisfocused react navigation 
Javascript :: jszip create zip file 
Javascript :: trim() javascript 
Javascript :: javascript input 
Javascript :: how to clone an object 
Javascript :: firefox freeze page 
Javascript :: node qrcode 
Javascript :: mongoose find multiple and update 
Javascript :: reset form jquery 
Javascript :: return object list in find js 
Javascript :: javascript range between two numbers 
Javascript :: jquery add class to body 
Javascript :: how to delete a message by its id discord.js 
Javascript :: how to add eslint to react project 
Javascript :: loops in javascript 
Javascript :: create new Next.js 
Javascript :: js add function to array 
Javascript :: javascript event currenttarget 
Javascript :: how to change html element in javascript 
Javascript :: execute command javascript 
Javascript :: js get index from foreach 
Javascript :: js add item to array 
Javascript :: length of list in javascript 
Javascript :: how to check if a string is an integer javascript 
Javascript :: what is adapter.js 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =