-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp.js
More file actions
31 lines (20 loc) · 661 Bytes
/
tmp.js
File metadata and controls
31 lines (20 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var fs = require('fs');
var fileName = './config.js.1';
var config = require(fileName);
console.log(config);
//console.log(config.contract_address);
//console.log(config.contract_abi);
config.contract_address = "address1";
config.contract_abi = "abi";
var newConfig = "module.exports = " + JSON.stringify(config) + ";";
console.log(newConfig);
fs.writeFile(fileName, JSON.stringify(config), function (err) {
if (err) return console.log(err);
console.log(JSON.stringify(config));
console.log('writing to ' + fileName);
});
/*
var seconds = 0;
if(String(seconds).length == 1) seconds = "0" + String(seconds);
console.log(seconds);
*/