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

@trietop/flotel

v0.3.1

Published

Fluent wrapper for OpenTelemetry Spans and Metrics.

Readme

Fluent OpenTelemetry JavaScript Wrapper

Provides a thin wrapper around the OpenTelemetry API components. Aims to reduce the boilerplate code required to manually instrument the span.

Example Usage

Simple method with OK status:

{
  let span = Spans.startSpan(tracer, 'simple');
  // do stuff
  span.ok();
}

Simple method with ERROR status that ends the span but no other side-effect:

{
  let span = Spans.startSpan(tracer, 'trap-and-record');
  try {
    // do stuff
    span.ok();
  } catch (e) {
    // Record the error to the span
    span.error('something bad happened');
  }
}

Re-throw the caught exception with an ended span. Will automatically record the exception and end the span:

{
  let span = Spans.startSpan(tracer, 'trap-and-throw');
  try {
    // do stuff
    span.ok();
  } catch (e) {
    // Trap and throw the exception
    span.doThrow(e);
  }
}

Return an error with an inline check using a custom exception type. Will automatically record the error and end the span:

{
  let span = Spans.startSpan(tracer, 'inline-error');
  try {
    // Check pre-conditions
    if (!requiredRef) {
      throw span.toError('required reference is not available', ReferenceError);
    }
    // do stuff
    span.ok();
  } catch (e) {
    // handle the error
  }
}

Return the caught exception with an ended span. Will automatically record the exception and end the span:

{
  let span = Spans.startSpan(tracer, 'trap-and-throw');
  try {
    // do stuff
    span.ok();
  } catch (e) {
    // Trap and re-throw the exception
    throw span.toThrow(e);
  }
}

Throw an error with an inline check. Will automatically record the error and end the span:

{
  let span = Spans.startSpan(tracer, 'inline-error');
  try {
    // Check pre-conditions
    if (!requiredVar) {
      span.doError('required value is not set');
    }
    // do stuff
    span.ok();
  } catch (e) {
    // handle the error
  }
}

Throw an error with an inline check using a custom exception type. Will automatically record the error and end the span:

{
  let span = Spans.startSpan(tracer, 'inline-error');
  try {
    // Check pre-conditions
    if (!requiredRef) {
      span.doError('required reference is not available', ReferenceError);
    }
    // do stuff
    span.ok();
  } catch (e) {
    // handle the error
  }
}

Installation

Add the following dependency:

npm install @trietop/flotel

OpenTelemetry API Compliance:

'@opentelemetry/api': ^1.0.3

Development

Check out the repository and run the following:

npm install
npm run build

Please provide all pull requests with an associated issue and branch.

Jest

Jest tests are set up to run with npm test.