express-debug is a development tool for express. It's simple middleware that injects useful debugging output into your html, in a non-obstructive way.
It adds an 'EDT' tab to the right side of pages that, when clicked, displays info such as template variables (locals), current session, useful request data, and current template.
If your application doesn't serve HTML, no worries, a standalone express-debug
panel is mounted at
/express-debug. See settings section for more information.
express-debug should NOT be used in production environments.
Compatible with express 3 and 4, node 0.8+
npm install express-debug --save-dev
var express = ;var app = ;app /* settings */;/* ... application logic ... */
depth - How deep to recurse through printed objects. This is the default unless the print_obj function is passed an options object with a 'depth' property.
theme - Absolute path to a css file to include and override EDT's default css.
panels - allows changing the default panels (ex: remove a panel)
['locals', 'request', 'session', 'template', 'software_info', 'profile'])
path - path to render standalone express-debug [set to
false to disable]
extra_attrs - If you need to add arbitrary attributes to the containing element of EDT, this allows you to. (For example, you may want to use "ng-non-bindable" if you're using angular)
sort - Global option to determine sort order of printed object values.
false for default order,
true for basic default sort, or a function to use for sort. See MDN Array sort
locals - app.locals, res.locals, and options passed to the template (merged into res.locals)
request - req info. ip, body, query, files, route info, cookies, headers
session - everything in req.session
template - view name, template file
software_info - shows current versions of node and libraries installed locally (not globally installed packages!)
profile - total req processing time. middleware, param, and route timings. (not a default panel; does not work with express 4.x yet)
other_requests - shows details on non-page requests made to the server (not a default panel, use extra_panels setting to invoke.
nav - links to every GET route in your app. (not a default panel)
extra_attrsoption to add html attributes to the rendered EDT container
sortoption (thanks to vaughan99)
1.0.0 API changes
Copyright (c) 2014 Tom Hunkapiller and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.