title: Ho to use third party library and declaration file?
body: <p>For my application I want to use a BSON. On the c++ server side I'm using mongodb bsoncxx so I decided to use the similar library in the browser. I found it <a href="https://github.com/mongodb/js-bson" rel="nofollow noreferrer">here</a>. Next I found a declaration file for this library <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bson" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I downloaded <a href="https://github.com/mongodb/js-bson/tree/1.0-branch/lib/bson" rel="nofollow noreferrer">this code</a> and put it into the <code>third_party/bson</code> folder in my project. Next I downloaded a <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/bson/index.d.ts" rel="nofollow noreferrer">declaration file</a>, renamed it to <code>bson.d.ts</code> and put into the same <code>third_party/bson</code> folder.</p>
  
  <p>In <code>Main.ts</code> I wrote:</p>
  
  <pre><code>import * as bson from './third_party/bson/bson';
  let BSON = new bson.BSON();
  </code></pre>
  
  <p>On build I have this error:</p>
  
  <pre><code>scripts/third_party/bson/bson.d.ts(7,1): error TS2688: Cannot find type definition file for 'node'.
  scripts/third_party/bson/bson.d.ts(27,100): error TS2304: Cannot find name 'Buffer'.
  scripts/third_party/bson/bson.d.ts(28,25): error TS2304: Cannot find name 'Buffer'.
  scripts/third_party/bson/bson.d.ts(40,25): error TS2304: Cannot find name 'Buffer'.
  scripts/third_party/bson/bson.d.ts(47,45): error TS2304: Cannot find name 'Buffer'.
  scripts/third_party/bson/bson.d.ts(51,19): error TS2304: Cannot find name 'Buffer'.
  scripts/third_party/bson/bson.d.ts(113,24): error TS2304: Cannot find name 'Buffer'.
  </code></pre>
  
  <p>What is <code>node</code>, why do I need it, how can I get it and where should I put it?</p>
  
  <p>Is there any way to get a library with all dependencies at once?</p>