stack-parser

0.0.1 • Public • Published

Error stack parser for node.js.

Installation

npm install stack-parser

Example

var stackParser = require('stack-parser');
 
var items = stackParser.parse((new Error).stack);
 
items.forEach(function(item) {
    console.log(item.format());
});
 
// Use custom formatting.
 
items.forEach(function(item) {
    console.log(item.format('%what (%file, line: %line, column: %column)'));
});
 
// Use custom short formatting.
 
items.forEach(function(item) {
    console.log(item.format('%w (%f, line: %l, column: %c)'));
});
 
// Get a "current stack", synonym for "stackParser.parse((new Error).stack);".
 
items = stackParser.here();

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    21,400
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    21,400

Package Sidebar

Install

npm i stack-parser

Weekly Downloads

21,400

Version

0.0.1

License

MIT

Last publish

Collaborators

  • scaryzet