Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/dtils/mod.ts>readJsonStrict

The best unofficial library of utilities for Deno applications
Go to Latest
function readJsonStrict
import { readJsonStrict } from "https://deno.land/x/dtils@2.6.0/mod.ts";

Read a file, parsing it as json. Returns an empty object if the file doesn't exist. Throws if the json can't be parsed.

NOTICE: At the next major release, this will return Json|null

Parameters

file: string

Returns

Promise<Json>