Answers for "typescript fs read json file"

9

write json file nodejs

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

let student = { 
    name: 'Mike',
    age: 23, 
    gender: 'Male',
    department: 'English',
    car: 'Honda' 
};
 
fs.writeFileSync(path.resolve(__dirname, 'student.json'), JSON.stringify(student));
Posted by: Guest on April-13-2020
0

typescript read json file

"resolveJsonModule": true,
"esModuleInterop": true,
Posted by: Guest on December-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language