Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Filter specified modules from the stack trace of an error object
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.npmignore
README.md
example.js
index.js
package.json
test.js

README.md

filter-stack

Filter specified modules from the stack trace of an error object

Install

$ npm install filter-stack

Usage

var filterStack = require('filterStack')

var err = new Error()

err.stack
// => Error: should be equal
//        at Test.assert (/dev/project/node_modules/foo/lib/lorem.js:178:54)
//        at Test.equal (/dev/project/node_modules/bar/lib/ipsum.js:301:10)
//        at Expect (/dev/project/lib/dolor.js:39:29)
//        at null._onTimeout (/dev/project/example.js:10:32)
//        at Timer.listOnTimeout (timers.js:110:15)

var exclude = [
  'foo',
  'bar'
]

filterStack(err, exclude).stack
// => Error: should be equal
//        at Expect (/dev/project/lib/dolor.js:39:29)
//        at null._onTimeout (/dev/project/example.js:10:32)
//        at Timer.listOnTimeout (timers.js:110:15)
Something went wrong with that request. Please try again.