-
Notifications
You must be signed in to change notification settings - Fork 8
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.
- Create a
generate
folder somewhere, and make it current. - Install Browserify, by running
npm i browserify
- Install
connnection-string
, by runningnpm i connection-string
- Make folder
node_modules/browserify/bin
current - Run
node cmd.js ../../connection-string/dist/index.js -o cs.js -s cs
- Copy generated
cs.js
file into your project