Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
/ meteor-inspector Public archive

Ensures that if meteor is in debug mode node-inspector is running

License

Notifications You must be signed in to change notification settings

broth-eu/meteor-inspector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meteor-inspector

By default meteor restarts each time a file has changed. If you are using node-inspector for debugging your meteor application you always have to restart the inspector manually to keep the UI connected to the debugger. With meteor-inspector installed (using meteorite) and invoked during the server startup, the node-inspector's lifecycle is managed in the background.

Prerequisites

You need to install node-inspector and meteorite globally (if not done yet):

$ npm install -g node-inspector
$ npm install -g meteorite

Usage

To use meteor-inspector in your project, you first have to install it in the project's directory:

$ cd /path/to/your/project
$ mrt add inspector

Furthermore, you have to invoke the inspector's runIfDebugging() method as first statement in a startup callback of your server:

if (Meteor.isServer) {
  Meteor.startup(function () {
    Inspector.runIfDebugging();
    // ...
  });
}

When debugging is enabled you are now able to use node-inspector as long as meteor is running, even after an automatic server restart. You are only required to refresh the debugger's website after each restart.

You simply can enable debugging in your current shell with:

$ export NODE_OPTIONS='--debug'

To disable it again, do the following:

$ unset NODE_OPTIONS

Configuration

The current implementation provides three parameters that can be delivered to the inspector's runIfDebugging() method in form of a settings object. If you refer to the defaultSettings variable declared in inspector.js, you see which parameters are available and how to utilize them.

About

Ensures that if meteor is in debug mode node-inspector is running

Resources

License

Stars

Watchers

Forks

Packages

No packages published