title: Where does the lib come from in typecsript?
body: <p>I have a typescript@2 project. I wanted to use some ecma2017 features. I found out that one can apply a <code>lib</code> in the <code>compilerOptions</code> in the <code>tsconfig.json</code>:</p>
  
  <pre><code>"target": "es6",
  "lib": [
      "es2017",
      "dom"
  ],
  </code></pre>
  
  <p>Yet why is this working? Where do these lib come from, what libs can one include?</p>
  
  <p>The closest to a documentation I could find was this <a href="https://github.com/Microsoft/TypeScript/wiki/What&#39;s-new-in-TypeScript#downlevel-async-functions" rel="nofollow noreferrer">this what's new entry</a>:</p>
  
  <blockquote>
    <h1>Downlevel Async Functions</h1>
    
    <p>This feature was supported before TypeScript 2.1, but only when targeting ES6/ES2015. TypeScript 2.1 brings the capability to ES3 and
    ES5 run-times, meaning you'll be free to take advantage of it no
    matter what environment you're using.</p>
    
    <p>Note: first, we need to make sure our run-time has an ECMAScript-compliant Promise available globally. That might involve
    grabbing a polyfill for Promise, or relying on one that you might have
    in the run-time that you're targeting. We also need to make sure that
    TypeScript knows Promise exists by setting your lib flag to something
    like "dom", "es2015" or "dom", "es2015.promise", "es5"</p>
  </blockquote>
  
  <p>yet I didn't find it particular helpful.</p>