GithubHelp home page GithubHelp logo

meslubi2021 / vscode-phantomjs-debug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iradul/vscode-phantomjs-debug

0.0 0.0 0.0 10.4 MB

A Visual Studio Code extension to debug your Javascript code on PhantomJS.

License: Other

TypeScript 100.00%

vscode-phantomjs-debug's Introduction

VS Code - Debugger for PhantomJS

Install

Download and install VSC

Open up VSC and install this extension:

  • open VSC
  • press CTRL+SHIFT+P, enter "install" and press Enter alternatively click on the button in bottom left corner and pick first option

alt step1

  • enter "phantom", wait a moment VSC will open up extension info box then click on the small button in the bottom right corner of the box

alt step2

Launch

Download PhantomJS executable.

Open your working directory in VSC. This can be done from menu or from console by typing code [path to directory]. If you are already in working directory just type code ..

Setup up VSC debugger:

  • click Debug button or press CTRL+SHIFT+D
  • create launch.json file manualy under ./.vscode/launch.json or by clicking on the small button that looks like cog then pick PhantomJS from the list that will open up

alt creating launch.json

  • edit launch.json by specifying :
    • full path to PhantomJS executable that you previously downloaded - runtimeExecutable
    • full path to PhantomJS JavaScript entrypoint file - file
    • root directory of your project - webRoot

If you write your code in TypeScript set sourceMaps to true. Also note that ts and js files have to be placed in the same directory.

If you are using PhantomJS modules you should put those in node_modules directory which should be child of your webRoot directory so that debugger can pick them up.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "phantomjs",
            "request": "launch",
            "file": "${workspaceRoot}/test.js",
            "webRoot": "${workspaceRoot}",
            "runtimeExecutable": "${workspaceRoot}/phantomjs.exe",
            "runtimeArgs": [],
            "scriptArgs": [],
            "sourceMaps": true
        }
    ]
}

Debug

Place breakpoints in your script(s) and press F5 to fire up phantom and start debugging. VSC debugger itself is very similar to javascript debuggers found in popular browsers like Google Chrome or Firefox for example. alt debugging

vscode-phantomjs-debug's People

Contributors

roblourens avatar jalissia avatar iradul avatar auchenberg avatar mslaguana avatar tyriar avatar justsml avatar isidorn avatar martinma avatar msftgits avatar basteln3rk avatar empoman 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.