Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pretty-trace

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-trace

Stacktrace prettyfier with theme support.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
decreased by-64.14%
Maintainers
1
Weekly downloads
 
Created
Source

pretty-trace build status

testling badge

Prettifies traces emitted by tools like lldb.

var prettyTrace = require('pretty-trace');

var lines = fs.readFileSync(__dirname + '/test/fixtures/lldb-trace.txt', 'utf8').split('\n');

var prettyLines = prettyTrace.lines(lines, prettyTrace.terminalTheme);
console.log(prettyLines.join('\n'))

lldb-trace

CLI

cat ./test/fixtures/lldb-trace.txt | pretty-trace

Installation

npm install pretty-trace

Used by resolve-jit-symbols.

prettyTrace::htmlTheme

A theme that surrounds the given trace using with spans classed trace-* in order to allow styling with CSS.

Source:
prettyTrace::regexes::instruments

Regexes used to match callgraphs generated with Mac Instruments.

Source:
prettyTrace::regexes::lldb

Regexes used to match debug traces created by tools like lldb.

Source:
prettyTrace::regexes::perf

Regexes used to match callgraphs generated running Linux perf, i.e. perf script.

Source:
prettyTrace::terminalTheme

A theme that colorizes the given trace using ANSI color codes.

Source:
prettyTrace::line(line, theme) → {string}

Prettifies the given line.

Parameters:
NameTypeDescription
line string

the line to be prettified

theme Object

theme that specifies how to prettify a trace

Properties
NameTypeDescription
raw function

invoked to surround an unparsable line

frame function

invoked to surround the frame number

address function

invoked to surround the hex address

symbol function

invoked to surround the symbol corresponding to the address, i.e. a function name

location function

invoked to surround the location in the file at which the symbol is found

Source:
Returns:

prettified line

Type
string
prettyTrace::lines(lines, theme) → {Array.<string>}

Prettifies multiple lines.

Parameters:
NameTypeDescription
lines Array.<string>

lines to be prettified

theme Object

theme that specifies how to prettify a trace @see prettyTrace::line

Source:
Returns:

the prettified lines

Type
Array.<string>

generated with docme

License

MIT

Keywords

FAQs

Package last updated on 01 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc