GithubHelp home page GithubHelp logo

skywinder / atom-node-debugger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiddkai/atom-node-debugger

0.0 3.0 0.0 4.36 MB

A Nodejs Debugger For Atom

License: MIT License

CoffeeScript 96.53% JavaScript 0.88% CSS 2.58%

atom-node-debugger's Introduction

node-debugger package

A simple Node.js/io.js debugger for daily use.

Usage

Open a javascript (.js) file and execute the start-resume command (F5) to launch the debugger.

Debug panels will show up as shown in the image below.

Screenshot of node-debugger in action

The '>' symbol in the gutter marks the current line of execution.

Execute the toggle-breakpoint (F9) command to set a breakpoint. The breakpoint will be displayed in the gutter using a red marker.

Execute start-resume (F5) again to resume debugging or use the step-next (F10), step-in (F11) or step-out (shift-F11) commands.

Commands

You may access the commands using CMD/Ctrl+p or by using the shortcut key specified within the brackets.

'node-debugger:start-resume' (F5)
'node-debugger:start-active-file' (ctrl-F5)
'node-debugger:stop' (shift-F5)
'node-debugger:toggle-breakpoint' (F9)
'node-debugger:step-next' (F10)
'node-debugger:step-in' (F11)
'node-debugger:step-out' (shift-F11)
'node-debugger:attach'
'node-debugger:toggle-debugger' (F12)

Configuration

The following attributes can be set to control the node-debugger.

  • nodePath - path to node.js executable, default: platform dependent
  • nodeArgs - arguments sent to node.js during launch, default: ''
  • appArgs - arguments sent to the application during launch, default: ''
  • debugHost - the machine name or ip-address of the host (only used when attaching to external node processes), default: '127.0.0.1'
  • debugPort - the port used to communicate to the launched process, default: 5858
  • env - the process environment variables (if left empty the environment will be inherited), default: ''
  • scriptMain - the preferred startup file, default: ''

An example of a configuration is given below.

"node-debugger":
  nodePath: "C:/program/nodejs/node.exe"
  nodeArgs: "--use-strict --use_inlining"
  appArgs: "--arg1=10 --arg2"
  debugHost: "192.168.0.20"
  debugPort: 5860
  env: "key1=value1;key2=value2;key3=value3"  
  scriptMain: "c:/myproject/main.js"

Debugging projects in atom

When executing the start-resume command the node-debugger will try to figure out which file that is the main file of the current atom project. This is the strategy being used:

  1. use configured entry point (scriptMain)
  2. attempt to read entry point from package.json in the project root folder
  3. attempt to start currently open file (ctrl+F5 hot-key)
  4. cannot start debugger

Attaching to external processes

Start your node application in debug mode using

>node --debug=5858 a.js

or

>node --debug-brk=5858 a.js

Make sure that your node-debugger settings for debugHost and debugPort are matching what you are using. In the case above debugPort should be 5858.

Execute command node-debugger: attach either from the menu or using the command panel.

Troubleshooting

Check in the node-debugger package settings that the node path is set correctly.

Feedback

Please click here to provide me more suggestions to improve this debugger, thanks :D

Todo

CoffeeScript support
Error Handling

Known issues

In Node.js>=0.12 and io.js. The process doesn't stop when your process finished. So it will have no response from debugger server and will not keep going debugging. When you face that issue, just use the x button to stop the process by yourself.

Issue report is here: nodejs/node#1788

atom-node-debugger's People

Contributors

arqex avatar campersau avatar cirpo avatar ckross01 avatar codecontemplator avatar eldarshamukhamedov avatar fthebaud avatar gitter-badger avatar kiddkai avatar mackieloeffel avatar matsmaker avatar rumkin avatar welbert avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.