backoffice/node_modules/stack-parser
root ab9f8bb658 first commit 2020-02-06 10:09:39 +00:00
..
LICENSE first commit 2020-02-06 10:09:39 +00:00
README.md first commit 2020-02-06 10:09:39 +00:00
index.js first commit 2020-02-06 10:09:39 +00:00
package.json first commit 2020-02-06 10:09:39 +00:00

README.md

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