I making a http.get()
database get and push script. This script get url and getting data for me
var database = http.get('anysite.com/awesomedata.json', function(res)/* and other codes etc: https://nodejs.org/api/http.html#http_http_get_url_options_callback */)
var db = database[mydata()] //my data is json.parse by url
var name = sirJohn
var password = worldbestpassword
db[].push({ [name] : [password] })
console.log(db)
I need to push a Template literal to my JSON data but I had to use another function inside “db”. How can I push it?
note* : var db = {}
like strings not very suitable
note2* : db.push()
not working tho and I need template literal for my real code. It’s just an example