My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to use a JSON file in TypeScript?

Reza Razavipour's photo
Reza Razavipour
·Dec 29, 2016

I have a file called men.json. I want to do the equivalent of var men = require('./men.json');

Whatever I have tried, it is looking for a ./men.json.js file. I read that I can not use import since it is not a .ts file

What is the equivalent of the require line?