Skip to content

Commit f930f6e

Browse files
authored
documentation: update documentation path pattern and add all *.md to lint checker (#2049)
* documentation: move to `documentation` * documentation: update the README documentation links * documentation: update the zh-cn README documentation links * documentation: update the Readme documentation links * documentation: change the README documentation links to local branch * documentation: change the Promise-Wrapper links to local branch * documentation: change the zh-cn README documentation links to local branch * documentation: change the documentation Readme links to local branch * documentation: update the Promise-Wrapper link * documentation: update the documentation link to `en` * fix: eslint markdown rules * fix: check for README.md in `lint:docs` script
1 parent d3dd182 commit f930f6e

File tree

13 files changed

+52
-46
lines changed

13 files changed

+52
-46
lines changed

.eslintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@
4646
"prettier"
4747
],
4848
"plugins": ["@typescript-eslint"]
49+
},
50+
{
51+
"files": ["**/*.md/*js"],
52+
"rules": {
53+
"no-undef": "off",
54+
"no-unused-vars": "off",
55+
"no-console": "off",
56+
"no-unused-labels": "off",
57+
"strict": "off",
58+
"prefer-arrow-callback": "off"
59+
},
60+
"parserOptions": {
61+
"sourceType": "module"
62+
}
4963
}
5064
]
5165
}

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
[![Windows Build][appveyor-image]][appveyor-url]
99
[![License][license-image]][license-url]
1010

11-
English | [简体中文](./documentation_zh-cn/)
11+
English | [简体中文](./documentation/zh-cn/)
1212

13-
> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more](https://github.com/sidorares/node-mysql2/tree/master/documentation)
13+
> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more](./documentation/en)
1414
1515
__Table of contents__
1616

@@ -32,14 +32,14 @@ MySQL2 project is a continuation of [MySQL-Native][mysql-native]. Protocol parse
3232
MySQL2 is mostly API compatible with [mysqljs][node-mysql] and supports majority of features. MySQL2 also offers these additional features
3333

3434
- Faster / Better Performance
35-
- [Prepared Statements](https://github.com/sidorares/node-mysql2/tree/master/documentation/Prepared-Statements.md)
35+
- [Prepared Statements](./documentation/en/Prepared-Statements.md)
3636
- MySQL Binary Log Protocol
37-
- [MySQL Server](https://github.com/sidorares/node-mysql2/tree/master/documentation/MySQL-Server.md)
37+
- [MySQL Server](./documentation/en/MySQL-Server.md)
3838
- Extended support for Encoding and Collation
39-
- [Promise Wrapper](https://github.com/sidorares/node-mysql2/tree/master/documentation/Promise-Wrapper.md)
39+
- [Promise Wrapper](./documentation/en/Promise-Wrapper.md)
4040
- Compression
41-
- SSL and [Authentication Switch](https://github.com/sidorares/node-mysql2/tree/master/documentation/Authentication-Switch.md)
42-
- [Custom Streams](https://github.com/sidorares/node-mysql2/tree/master/documentation/Extras.md)
41+
- SSL and [Authentication Switch](./documentation/en/Authentication-Switch.md)
42+
- [Custom Streams](./documentation/en/Extras.md)
4343
- [Pooling](#using-connection-pools)
4444

4545
## Installation
@@ -145,18 +145,18 @@ You can use the pool in the same way as connections (using `pool.query()` and `p
145145
```js
146146
// For pool initialization, see above
147147
pool.query("SELECT field FROM atable", function(err, rows, fields) {
148-
// Connection is automatically released when query resolves
148+
// Connection is automatically released when query resolves
149149
})
150150
```
151151

152152
Alternatively, there is also the possibility of manually acquiring a connection from the pool and returning it later:
153153
```js
154154
// For pool initialization, see above
155155
pool.getConnection(function(err, conn) {
156-
// Do something with the connection
157-
conn.query(/* ... */);
158-
// Don't forget to release the connection when finished!
159-
pool.releaseConnection(conn);
156+
// Do something with the connection
157+
conn.query(/* ... */);
158+
// Don't forget to release the connection when finished!
159+
pool.releaseConnection(conn);
160160
})
161161
```
162162

@@ -204,6 +204,7 @@ async function main() {
204204
const promisePool = pool.promise();
205205
// query database using promises
206206
const [rows,fields] = await promisePool.query("SELECT 1");
207+
}
207208
```
208209

209210
MySQL2 exposes a .promise() function on Connections, to "upgrade" an existing non-promise connection to use promise
@@ -258,7 +259,7 @@ If you find any other incompatibility with [Node MySQL][node-mysql], Please repo
258259

259260
## Documentation
260261

261-
You can find more detailed documentation [here](https://github.com/sidorares/node-mysql2/tree/master/documentation). You should also check various code [examples](https://github.com/sidorares/node-mysql2/tree/master/examples) to understand advanced concepts.
262+
You can find more detailed documentation [here](./documentation/en). You should also check various code [examples](./examples) to understand advanced concepts.
262263

263264
## Acknowledgements
264265

documentation/.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

documentation/Promise-Wrapper.md renamed to documentation/en/Promise-Wrapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ co(function * () {
5757
yield c.end();
5858
});
5959
```
60-
Examples in [/examples/promise-co-await](https://github.com/sidorares/node-mysql2/tree/master/examples/promise-co-await)
60+
Examples in [/examples/promise-co-await](../../examples/promise-co-await)

documentation/Readme.md renamed to documentation/en/Readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
Not only `Node-MySQL2` offers better performance over `node-mysql`, we also support these additional features.
1010

11-
- [Prepared Statements](https://github.com/sidorares/node-mysql2/tree/master/documentation/Prepared-Statements.md)
12-
- [Promise Wrapper](https://github.com/sidorares/node-mysql2/tree/master/documentation/Promise-Wrapper.md)
13-
- [Authentication Switch](https://github.com/sidorares/node-mysql2/tree/master/documentation/Authentication-Switch.md)
14-
- [More Features](https://github.com/sidorares/node-mysql2/tree/master/documentation/Extras.md)
15-
- [MySQL Server](https://github.com/sidorares/node-mysql2/tree/master/documentation/MySQL-Server.md)
11+
- [Prepared Statements](./Prepared-Statements.md)
12+
- [Promise Wrapper](./Promise-Wrapper.md)
13+
- [Authentication Switch](./Authentication-Switch.md)
14+
- [More Features](./Extras.md)
15+
- [MySQL Server](./MySQL-Server.md)
1616
- Pooling
1717
- SSL
1818
- MySQL Compression
1919
- Binary Log Protocol Client
2020

2121
## Examples
2222

23-
Please check these [examples](https://github.com/sidorares/node-mysql2/tree/master/documentation/Examples.md) for `node-mysql2`.
23+
Please check these [examples](./Examples.md) for `node-mysql2`.
2424

2525

2626
## Known incompatibilities with `node-mysql`
@@ -48,4 +48,4 @@ You need to check corresponding field's zeroFill flag and convert to string manu
4848
- https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b
4949
- `npm run benchmarks`
5050
- [node-mysql-benchmarks](https://github.com/mscdex/node-mysql-benchmarks)
51-
- try to run example [benchmarks](https://github.com/sidorares/node-mysql2/tree/master/benchmarks) on your system
51+
- try to run example [benchmarks](../../benchmarks) on your system

0 commit comments

Comments
 (0)