You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SQL Formatter source code is written in ES2015 but we precompile both CommonJS and UMD builds to ES5 so they work in any modern browser.
19
19
20
-
If you don't use a module bundler then you can drop a file from `/dist` directory as a `<script>` tag on the page. This makes SQL Formatter available as a `window.SqlFormatter` global variable.
20
+
If you don't use a module bundler then you can drop a file from `/dist` directory as a `<script>` tag on the page. This makes SQL Formatter available as a `window.sqlFormatter` global variable.
21
21
22
22
## Example usage
23
23
24
24
First we need to import our CommonJS module and then we can use it for formatting
25
25
standard SQL query.
26
26
27
27
```js
28
-
importSqlFormatterfrom"sql-formatter";
28
+
importsqlFormatterfrom"sql-formatter";
29
29
30
-
constformattedStandardSql=newSqlFormatter().format("sql", "SELECT * FROM table1");
30
+
constformattedStandardSql=sqlFormatter.format("SELECT * FROM table1");
31
31
```
32
32
33
33
The value of `formattedStandardSql` will look like this:
0 commit comments