Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Key Points

...

/Users/jimmason/Documents/Github/ebc-api

>> git commit --dry-run -m 'fix trade accounting jim'

On branch dev

Your branch is up to date with 'origin/dev'.

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git restore <file>..." to discard changes in working directory)

modified:   src/services/offers/offers.hooks.js

modified:   src/services/trades/trades.hooks.js

no changes added to commit (use "git add" and/or "git commit -a")


VSCode offers timeline to view manage changes between versions locally


Select a file in Explorer > select timeline << versions listed

...

nodejs-tutorial-code.visualstudio-Nodejs tutorial in Visual Studio Code.pdf

Note: If you've been using the VS Code integrated terminal to install the Express generator and scaffold the app, you can open the myExpressApp folder from your running VS Code instance with the File > Open Folder command.

VSCode uses Typescript to create metadata in the app

VS Code uses TypeScript type declaration (typings) files (for example node.d.ts) to provide metadata to VS Code about the JavaScript based frameworks you are consuming in your application. Type declaration files are written in TypeScript so they can express the data types of parameters and functions, allowing VS Code to provide a rich IntelliSense experience. Thanks to a feature called Automatic Type Acquisition, you do not have to worry about downloading these type declaration files, VS Code will install them automatically for you.

Debug Nodejs app 

The debug and terminal views can be opened from the View menus

...

If the Auto Attach feature is enabled, the Node debugger automatically attaches to certain Node.js processes that have been launched from VS Code's Integrated Terminal. To enable the feature, either use the Toggle Auto Attach command from the command palette (F1) or, if it's already activated, use the Auto Attach Status bar item.

...

You can apply other properties normally found in launch.json to auto attach in the debug.javascript.terminalOptions setting. For example, to add node internals to your skipFiles, you could add the following to your user or workspace settings:

  "debug.javascript.terminalOptions": {
    "skipFiles": [
      "<node_internals>/**"
    ]
  },

Auto Attach Smart Patterns

In smart Auto Attach mode, VS Code will try to attach to your code, and not attach to build tools you aren't interested in debugging. It does this by matching the main script against a list of glob patterns. The glob patterns are configurable in the debug.javascript.autoAttachSmartPattern setting, which defaults to:

[
  '!**/node_modules/**', // exclude scripts in node_modules folders
  '**/$KNOWN_TOOLS$/**' // but include some common tools
];

$KNOWN_TOOLS$ is replaced list a list of common 'code runners' such as ts-node, mocha, ava, and so on. You can modify this list if these settings don't work. For example, to exclude mocha and include my-cool-test-runner, you could add two lines:

[ '!**/node_modules/**', '**/$KNOWN_TOOLS$/**', '!**/node_modules/mocha/**', // use "!" to exclude all scripts in "mocha" node modules '**/node_modules/my-cool-test-runner/**'// include scripts in the custom test runner ];

...

In a similar way to auto attach, the JavaScript Debug Terminal will automatically debug any Node.js process you run in it. You can create a Debug Terminal by running the use the Debug: Create JavaScript Debug Terminal command from the command palette (F1), or by selecting the Create JavaScript Debug Terminal from the terminal switcher dropdown.

...

You can apply other properties normally found in launch.json to the debug terminal in the debug.javascript.terminalOptions setting. For example, to add node internals to your skipFiles, you could add the following to your user or workspace settings:

"debug.javascript.terminalOptions": {
  "skipFiles": [
    "<node_internals>/**"
  ]
},

Launch Configuration#

Launch configs are the traditional way to set up debugging in VS Code, and provide you the most configuration options for running complex applications.

...

You can trigger IntelliSense (⌃Space) in your launch.json file to see launch configuration snippets for commonly used Node.js debugging scenarios.

...