Skip to content

Browsers

Vitaly Tomilov edited this page Jun 19, 2020 · 10 revisions

As explained on the main page, the easiest is to use this library from within a browser is via TypeScript, so you can bundle it any way you want. And that is why this library does not ship with the browser file, to avoid bloating.

If, however, you do need to include it manually into an HTML page, you can create such browser-compatible file yourself, using Browserify, as shown in the example below.

Example below will generate a single JavaScript file with the complete connection-string library, which then can be included directly into any HTML page, with all types available from the cs namespace.

  1. Create a generate folder somewhere, and make it current.
  2. Install Browserify, by running npm i browserify
  3. Install connnection-string, by running npm i connection-string
  4. Make folder node_modules/browserify/bin current
  5. Run node cmd.js ../../connection-string/dist/index.js -o cs.js -s cs
  6. Copy generated cs.js file into your project
Clone this wiki locally