Profile picture of Liam Moat

Liam Moat

Principal Software Engineer at Microsoft

TypeScript

Page 1 of 1. See all tags.

Import JSON files with TypeScript

By Liam Moat.

TypeScript 2.9, which was released in May 2018, introduced a new compiler option called resolveJsonModule. This allows you to import .json files and interpret the contents as a well-typed JavaScript Object - which means the compiler will recognise types like string, number and boolean.