Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node js reuire json shows onject

var readJson = (path, cb) => {
  fs.readFile(require.resolve(path), (err, data) => {
    if (err)
      cb(err)
    else
      cb(null, JSON.parse(data))
  })
}
Source by goenning.net #
 
PREVIOUS NEXT
Tagged: #node #js #reuire #json #shows #onject
ADD COMMENT
Topic
Name
4+8 =