npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lynx-js/trace-query

v0.0.5

Published

Lynx trace query library and CLI tool

Readme

@lynx-js/trace-query

A library for querying trace data using the Perfetto trace processor.

Installation

pnpm add @lynx-js/trace-query

Usage

Programmatic

import { TraceQuery, queryById, queryByTimeWindow } from '@lynx-js/trace-query';

const traceQuery = new TraceQuery();
await traceQuery.initProcessor('/path/to/trace.pftrace');

// Query by ID
const slice = await queryById(traceQuery, 123);

// Query by time window
const slices = await queryByTimeWindow(traceQuery, 1000, 2000);

await traceQuery.destroyProcessor();

CLI

# Show help
node dist/cli/index.js --help

# Query by slice ID
node dist/cli/index.js id --id 381 --path "https://example.com/trace.pftrace"

# Query by time window
node dist/cli/index.js time-window --start 1000 --end 2000 --path "/path/to/trace.pftrace"

# Query metadata
node dist/cli/index.js metadata --path "/path/to/trace.pftrace"

# Execute raw SQL
node dist/cli/index.js sql --query "SELECT * FROM slice LIMIT 10" --path "/path/to/trace.pftrace"

# Query metrics
node dist/cli/index.js metrics --path "/path/to/trace.pftrace"

# Query threads
node dist/cli/index.js threads --path "/path/to/trace.pftrace"

# Query long tasks (threshold: 16ms)
node dist/cli/index.js long-tasks --track 6 --duration 16 --path "/path/to/trace.pftrace"

CLI Commands

| Command | Description | |---------|-------------| | id | Query slice by ID | | time-window | Query slices within a time range | | aggregate | Aggregate events by name | | ancestors | Query ancestor slices | | descendants | Query descendant slices | | flow | Query flow events | | metadata | Query trace metadata | | lynxview | Query LynxView instances | | pipeline | Query pipeline IDs | | pipeline-overview | Query pipeline overview events | | metrics | Query Lynx rendering metrics | | threads | Query all threads | | long-tasks | Query long tasks on a track | | sql | Execute raw SQL query |

All commands require -p, --path <path> to specify the trace file (URL or local path).

Query Methods

| Method | Description | |--------|-------------| | queryById | Query a slice by its ID | | queryByTimeWindow | Query slices within a time window | | queryAggregate | Aggregate events by name pattern | | queryAncestors | Get ancestor slices | | queryDescendants | Get descendant slices | | queryFlowEvents | Get flow events for a slice | | queryLynxView | Get LynxView instances | | queryPipelineIds | Get pipeline IDs for an instance | | queryPipelineOverviewEvents | Get pipeline overview events | | queryTraceMetadata | Get trace metadata | | queryMetrics | Get Lynx rendering metrics | | queryThreads | Get all threads with track IDs | | queryLongTasks | Get long tasks exceeding duration threshold | | queryByRawSql | Execute raw SQL |

Project Structure

src/
├── cli/                  # CLI implementation
│   └── index.ts          # Command definitions
├── queries/              # Query implementations
├── trace_processor/      # Trace processor integration
├── types/                # Type definitions
└── utils/                # Utility functions

License

Apache License Version 2.0