@epic-js/express-profiler 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,18 +10,19 @@ npm install express-profiler
|
|
|
10
10
|
## Usage
|
|
11
11
|
```js
|
|
12
12
|
const express = require('express');
|
|
13
|
-
const
|
|
14
|
-
const { wrapAsync } = require('express-profiler/wrappers');
|
|
13
|
+
const apiProfiler = require('@epic-js/express-profiler');
|
|
15
14
|
|
|
16
15
|
const app = express();
|
|
17
16
|
app.use(expressProfiler());
|
|
18
17
|
|
|
18
|
+
app.listen(3000);
|
|
19
|
+
```
|
|
20
|
+
## After finding the slow routes dig deeper by using the wrapAsync
|
|
21
|
+
```js
|
|
19
22
|
app.get('/users', async (req, res) => {
|
|
20
23
|
const users = await wrapAsync(async () => [{ id: 1, name: 'Alice' }], 'DB', req)();
|
|
21
24
|
res.send(users);
|
|
22
25
|
});
|
|
23
|
-
|
|
24
|
-
app.listen(3000);
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
## CLI Usage
|