title: How to get `CompilerOptions` from `tsconfig.json`
body: <p>I'm working with the TypeScript compiler API. When initializing a program, I'm asked to supply a <code>CompilerOptions</code> object. I want to use the <code>CompilerOptions</code> for a given <code>tsconfig.json</code> file, but I can't seem to figure out what the right way is to get this.</p>
  <p>I think I'm supposed to use <code>parseJsonConfigFileContent</code> but that also needs a <code>ParseConfigHost</code>. <a href="https://github.com/Microsoft/TypeScript/issues/5276#issuecomment-351145208" rel="noreferrer">They say</a> that it's easy to implement yourself, but particularly the method <code>readDirectory</code> seems rather complicated to implement yourself. As far as I can see, you need to return all TypeScript files in a certain directory, accounting for a <code>excludes</code> and <code>includes</code>.</p>
  <p>Surely, TypeScript does this internally somewhere already. How can I use the default <code>readDirectory</code> or <code>ParseConfigHost</code>?</p>
  <p>Phrased in another way: what's the simplest way to get the <code>CompilerOptions</code> for a given TypeScript project?</p>