Skip to content
This repository was archived by the owner on Dec 28, 2021. It is now read-only.

Commit 85b8fa5

Browse files
committed
Improve usability of Windows notes w/ examples for prompts & npm script
(debug-js/debug#577)
1 parent 71031ea commit 85b8fa5

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,44 @@ Here are some examples:
7676
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
7777
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
7878

79-
### Windows note
79+
### Windows command prompt notes
80+
81+
#### CMD
8082

8183
On Windows the environment variable is set using the `set` command.
8284

8385
```cmd
8486
set DEBUG=*,-not_this
8587
```
8688

87-
Note that PowerShell uses different syntax to set environment variables.
89+
Example:
90+
91+
```cmd
92+
set DEBUG=* & node app.js
93+
```
94+
95+
#### PowerShell (VS Code default)
96+
97+
PowerShell uses different syntax to set environment variables.
8898

8999
```cmd
90100
$env:DEBUG = "*,-not_this"
91101
```
92102

103+
Example:
104+
105+
```cmd
106+
$env:DEBUG='app';node app.js
107+
```
108+
93109
Then, run the program to be debugged as usual.
94110

111+
npm script example:
112+
113+
```javascript
114+
"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
115+
```
116+
95117
## Namespace Colors
96118

97119
Every debug instance has a color generated for it based on its namespace name.

0 commit comments

Comments
 (0)