Package Exports
- rawkit
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rawkit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rawkit grabs the chrome inspector URL returned from the node --inspect command and immediately opens devtools. No more clicking, selecting, copying/pasting or navigating. Just run the command and jump into debugging.
Installation
$ npm i rawkit -gor
$ yarn global add rawkitRun
$ rawkit index.jsor utilizing npx
$ npx rawkit example.js
Options
By default, running rawkit can detect any main script that's been defined in the current working directory's package.json and run that. It also will detect the version of Node.js you're running to determine whether or not to fallback to older debug APIs.
--inspect-brk alias brk
To break on the first line of the application code.
--inspect-port alias p
The debugger port. Defaults to 9229.
--canary alias c
Open the devtools in canary.
--nodemon alias n
Use nodemon to run/watch your node process & reload when files change. rawkit supports all the default configuration options for nodemon including execMap inside our project's package.json or nodemon.json files.
Example
$ rawkit --nodemon -e js,jade server.js--silent alias s
Hide stdout/stderr output from child process in the terminal window.
--executable=[name] alias e
Specify the name of the executable. Defaults to google chrome.
Note:
--executableis an experimental feature as rawkit typically does all the work to determine the right executable to use based on your operating system and any other arguments or environmental configuration.
FAQ
Chrome opens to a blank page?
You may have some issues if your version of Chrome has recently updated and it and/or your OS hasn't be restarted. Quick fix here is to just try restarting Chrome and/or restarting your machine. This was identified in the opn project.
Should this be in node core?
Maybe. A flag like --launch would be a nice supplement to --inspect. That said...
Do I need to install a Chrome Extension?
rawkit will automatically launch a splash page asking you to install a corresponding Chrome Extension the first time you run it. If you don't want to install the extension, and are on a Mac, you can install chrome-cli to get around this. rawkit will automatically detect if chrome-cli exists on your machine and use that to open/launch chrome once it's installed.
$ brew install chrome-cliUnfortunately, opening internal Chrome links, externally, is not possible without an aid at the moment (ie. urls that contain chrome:// or chrome-devtools:// in this case). This is most likely a security feature. That said, you can use a Chrome Extension as a proxy to make this work. Check out the RESEARCH.md for more information. You can also use something like this lighthouse/chrome-launcher.