When I require data.json
in node Why node doesn't serialise info
object in following json structure?
data.json
{
"mailOptions": {
"from": "from me",
"service": "gmail",
"auth": {
"user": "username",
"pass": "password",
"info": {
"name": "myname"
}
}
}
}
The output result is:
> require('./data.json')
{ mailOptions:
{ from: 'from me',
service: 'gmail',
auth: { user: 'username', pass: 'password', info: [Object] } } }
There is an answer here which suggests to use util.inspect
function but for some reason it isn't working for me.
So, Two questions:
- I am curious to know the reason behind this
- How I can get the complete object serialised?
Thanks
via Nexus23
No comments:
Post a Comment