Logo

Programming-Idioms

History of Idiom 91 > diff from v24 to v25

Edit summary for version 25 by blakecallens:
New JS implementation by user [blakecallens]

Version 24

2018-12-07, 12:53:46

Version 25

2019-09-26, 17:01:19

Idiom #91 Load JSON file into struct

Read from file data.json and write its content into object x.
Assume the JSON data is suitable for the type of x.

Idiom #91 Load JSON file into struct

Read from file data.json and write its content into object x.
Assume the JSON data is suitable for the type of x.

Imports
const fs = require('fs');
Code
const x = JSON.parse(fs.readFileSync('./data.json'));