query
On this page

importJSON

lib.importJSON

Docs pulled from | This Revision | about 1 hour ago


Reads a JSON file.

Examples

lib.trivial.importJSON usage example

example.json

{
  "title": "Example JSON",
  "hello": {
    "world": "foo",
    "bar": {
      "foobar": true
    }
  }
}
importJSON ./example.json
=> {
  title = "Example JSON";
  hello = {
    world = "foo";
    bar = {
      foobar = true;
    };
  };
}

Inputs

path

1. Function argument

Type

importJSON :: path -> any
(lib.trivial.importJSON)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

importJSON = path:
    builtins.fromJSON (builtins.readFile path);