From 1ad1e4a79ff36981c1972bb4e61f93c7d4ade68d Mon Sep 17 00:00:00 2001 From: KyleStay Date: Wed, 20 Jun 2018 18:49:49 -0400 Subject: [PATCH] Improve usability of Windows notes w/ examples for prompts & npm script (#577) * Improve usability of Windows notes w/ examples for prompts & npm script * Made changes requested for pull request https://github.com/visionmedia/debug/pull/577#pullrequestreview-130549763 --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a3b70b..b9f4b49 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,9 @@ Here are some examples: screen shot 2017-08-08 at 12 53 38 pm screen shot 2017-08-08 at 12 53 25 pm -#### Windows note +#### Windows command prompt notes + +##### CMD On Windows the environment variable is set using the `set` command. @@ -78,14 +80,32 @@ On Windows the environment variable is set using the `set` command. set DEBUG=*,-not_this ``` -Note that PowerShell uses different syntax to set environment variables. +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. ```cmd $env:DEBUG = "*,-not_this" ``` +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + Then, run the program to be debugged as usual. +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` ## Namespace Colors