title: Read In JSON File Into TypeScript
body: <p>I've created a JSON file and want to read it into TypeScript so I can return it on a function call.</p>
  
  <p>However I keep getting the error:</p>
  
  <pre><code>[ts] Cannot find module './example.json'.
  </code></pre>
  
  <p>Here is my example.json which is running from same location of current file</p>
  
  <pre><code>{"cars": ["red", "green"] }
  </code></pre>
  
  <p>And here is my TypeScript</p>
  
  <pre><code>declare module "*.json" {
  const value: any;
  export default value;
  }import * as data from './example.json';
  
  function getJson {
  const word = (&lt;any&gt;data).cars;
  console.log(word);
  }
  </code></pre>