A fast, interactive web-based viewer for performance profiles with support for multiple profiler formats
—
Node.js command-line interface for opening speedscope with profile files in the browser. The CLI automatically detects profile formats, handles file reading, and launches the web interface with the profile data.
Primary CLI interface for launching speedscope with profile files.
# Open empty speedscope in browser
speedscope
# Open speedscope with a specific profile file
speedscope profile.json
# Read profile from stdin
cat profile.json | speedscope -
echo "profile_data" | speedscope -
# Show help information
speedscope --help
speedscope -h
# Show version information
speedscope --version
speedscope -vThe CLI accepts the following arguments and flags:
- (dash): Reads profile data from stdin--help, -h: Shows help message and usage information--version, -v: Shows the current speedscope versionCore functions used internally by the CLI (not directly exposed for external use).
/**
* Get readable stream from file path or stdin
* @param relPath - Relative file path or '-' for stdin
* @returns Readable stream for the profile data
*/
function getProfileStream(relPath: string): NodeJS.ReadableStream;
/**
* Read profile data into buffer from file or stdin
* @param relPath - Relative file path or '-' for stdin
* @returns Promise resolving to Buffer containing profile data
*/
function getProfileBuffer(relPath: string): Promise<Buffer>;
/**
* Main CLI entry point with argument parsing and browser launching
* Handles all CLI arguments and orchestrates the profile loading process
* @returns Promise that resolves when CLI execution completes
*/
function main(): Promise<void>;The CLI automatically handles various file scenarios:
The CLI integrates with the system browser using the following approach:
Usage Examples:
# Basic usage - open specific profile
speedscope cpu-profile.json
# Pipeline usage - process and view profile
some-profiler --output=json | speedscope -
# Multiple profile formats supported
speedscope trace.chrome.json # Chrome DevTools
speedscope profile.stackprof.json # Ruby stackprof
speedscope callgrind.out.12345 # Callgrind format
speedscope profile.pb.gz # Go pprof (compressed)
# Version and help
speedscope --version # Show version: v1.23.1
speedscope --help # Show usage helpThe CLI provides comprehensive error handling for common scenarios:
The CLI is designed to work across different operating systems:
For large profiles that exceed URL parameter limits, the CLI:
The temporary file naming pattern: speedscope-{timestamp}-{pid}.js
// CLI help string displayed with --help
const helpString: string;
// Main CLI function type
type MainFunction = () => Promise<void>;
// Profile processing function types
type GetProfileStream = (relPath: string) => NodeJS.ReadableStream;
type GetProfileBuffer = (relPath: string) => Promise<Buffer>;Install with Tessl CLI
npx tessl i tessl/npm-speedscope