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
Copy file name to clipboardExpand all lines: README.md
+18-21Lines changed: 18 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,49 +20,46 @@ The preferred method is global install but can optionally be placed locally as w
20
20
```
21
21
22
22
23
-
####Add the reporting module to your code
23
+
### Add the reporting module
24
24
25
-
There are a couple patterns for including `nodejs-dashboard` in your code. Since this module isn't designed for production use it's best to conditionally include.
26
-
27
-
##### Including via preload argument
28
-
29
-
This pattern requires you to use a run-time flag (see below).
There are a couple patterns for including `nodejs-dashboard` in your code. This module isn't designed for production use and should be limited to development environments.
34
26
35
27
##### Including via code
36
28
37
29
From within a `dev.index.js` script or other dev entry point simply require the `nodejs-dashboard` module.
38
30
39
-
```
31
+
```js
32
+
// dev.index.js
40
33
require("nodejs-dashboard");
34
+
require("./index");
41
35
```
42
36
43
-
#### Update your package.json
44
-
45
-
It's recommended that you create a npm script to launch the dashboard. How you decide to include the module will dictate the run script.
46
-
47
-
For example, if you want to conditionally include via requires flag see the following example.
37
+
Next update your `package.json` to launch the dashboard:
In this example we've included the module in a custom development entry point.
47
+
##### Including via preload argument
48
+
49
+
This method utilizes Node's `-r` flag to introduce the `nodejs-dashboard` module. In this setup no code modifications are required. This is functionally equivalent to the above example.
0 commit comments