Skip to content

Read a JSON file

The fs.open function is used to open a file and return a std.fs.File instance, in

The json.from_reader function is used to parse a JSON string from a reader and return a T instance base on the T type parameter.

INFO

The std.fs.File is has implemented the std.io.Read interface, so you can use it for json.from_reader function.

nv,

If we have a user.json:

json