GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - floatdrop/express-error-with-sources: Error handler which displays source code in error stack for JavaScript

This repository was archived by the owner on Jun 24, 2025. It is now read-only.
BranchesTags
Open more actions menu
 
 

Latest commit

 

History

82 Commits
82 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
img
img
 
 
lib
lib
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.jshintrc
.jshintrc
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

express-error-with-sources Build Status

Enhanced express 3 error handler which inserts source code within error stack for JavaScript.

Deprecated: use express-stackman instead

Usage

Install module:

npm i express-error-with-sources --save

Insert middleware into your express app:

// Be sure to add it after `.get`, `.post` and ohters routers - otherwise error will be not intercepted

app.configure('development', function() {
  app.use(require('express-error-with-sources')({contextSize: 3}));
});

Options

  • contextSize - Number of lines to insert before and after the error line (default: 3)
  • title - Title of html error page (default: Error)
  • depth - How deep util.inspect should go (default: 5)

Html output

You can see instant example by doing this:

git clone https://github.com/floatdrop/node-parsetrace && cd $_
npm i && node example

Open http://localhost:3000 for exception example or http://localhost:3000/object for object example.

On http://localhost:3000 you should see something like that:

screenshot

(If you not - write an issue, we will figure it out)

Text output

For text-output use parsetrace.

License

The MIT License (MIT) Copyright (c) 2012 Barc, Inc.

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.

About

Error handler which displays source code in error stack for JavaScript

Resources

Readme
MIT license
Activity

Stars

55 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.