node js read json file to object
If the encoding is set to buffer, the path returned will be passed as a Buffer object. Note: On Linux, when Node.js is linked against musl libc, the procfs file system must be mounted on /proc in order for this function to work. Type the command node PrintJsonData.js and press enter key. Below steps demonstrates reading data from JSON object.File Name: PrintJsonDataSync.js var jf require(jsonfile) var file BookInfo. json. This article explains you to upload, read and convert excel files to json in Node.