Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to read a json file in node js

const path = require('path')
const fs = require('fs')

blogs = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/blogs.json')).toString())
 
PREVIOUS NEXT
Tagged: #read #json #file #node #js
ADD COMMENT
Topic
Name
1+7 =