Skip to content

Commit 0d9deb1

Browse files
Merge pull request taozhi8833998#269 from taozhi8833998/feature-readme
update readme
2 parents f0b902c + 3355f46 commit 0d9deb1

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ lib/
55
.nyc_output/
66
.coveralls.yml
77
bower_components/
8+
umd/

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ npm install @taozhi8833998/node-sql-parser --registry=https://npm.pkg.github.com
4949
Import the JS file in your page:
5050

5151
```javascript
52-
<script src="https://unpkg.com/node-sql-parser@latest/parser.min.js"></script>
52+
<script src="https://unpkg.com/node-sql-parser/umd/parser.min.js"></script>
5353
```
5454
- `latest` is the version that could be replaced by a specified version, such as `1.7.13`
5555
- `NodeSQLParser` object is on `window`
@@ -63,13 +63,15 @@ Import the JS file in your page:
6363
</head>
6464
<body>
6565
<p><em>Check console to see the output</em></p>
66-
<script src="https://unpkg.com/node-sql-parser@latest/parser.min.js"></script>
66+
<script src="https://unpkg.com/node-sql-parser/umd/parser.min.js"></script>
6767
<script>
6868
window.onload = function () {
69-
// Example parser
70-
const parser = new NodeSQLParser.Parser()
71-
const ast = parser.astify("select id, name from students where age < 18")
72-
console.log(ast)
69+
// Example parser
70+
const parser = new NodeSQLParser.Parser()
71+
const ast = parser.astify("select id, name from students where age < 18")
72+
console.log(ast)
73+
const sql = parser.sqlify(ast)
74+
console.log(sql)
7375
}
7476
</script>
7577
</body>

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "node-sql-parser",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "simple node sql parser",
55
"main": "index.js",
66
"types": "index.d.ts",
77
"scripts": {
88
"build": "rm -rf build/* && mkdir -p build && node build.js && npm run compile",
99
"test": "NODE_ENV=test npm run lint && mocha --recursive --require @babel/register",
1010
"compile": "babel src -d lib",
11-
"browser": "browserify -p tinyify index.js -o parser.min.js",
11+
"browser": "browserify -p tinyify index.js -o umd/parser.min.js",
1212
"lint": "npm run build && eslint src/",
1313
"prepublishOnly": "npm run build && npm run browser",
1414
"coverLocal": "nyc npm run test",
@@ -33,10 +33,10 @@
3333
"author": "taozhi8833998 <taozhi8833998@163.com>",
3434
"files": [
3535
"index.js",
36-
"parser.min.js",
3736
"lib/",
3837
"index.d.ts",
3938
"build/",
39+
"umd/",
4040
"README.md",
4141
"LICENSE"
4242
],

0 commit comments

Comments
 (0)