Answers for "como leer un data json en javascript"

0

json encode js

// To encode an object (This produces a string)
var json_str = JSON.stringify(myobject); 

// To decode (This produces an object)
var obj = JSON.parse(json_str);
Posted by: Guest on September-02-2021
0

como ler um arquivo json com javascript

const { read } = require('fs')
const readJsonFile = file => {
  if (file.split('.')[file.split('.').length - 1] !== 'json') return {}

  const fileContent = read(file)

  if (!fileContent) return {}

  return JSON.parse(fileContent)
}
readJsonFile('package.json')
Posted by: Guest on July-04-2020

Code answers related to "como leer un data json en javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language