1.2.1 • Published 5 years ago
savejsontofile v1.2.1
savejsontofile
npm i savejsontofileUsage
saveJsonToFile(
{
name: 'Karthick',
occupation: 'Web Developer',
}, // Json object
'output.json', // Output path
false, // Flatten
)Output file
// output.json
{"name":"Karthick","occupation":"Web Developer"}It helps to easily export the logs or complex objects to a file to debug easily. The library also comes with flattening support that helps fix TypeError: Converting circular structure to JSON error.