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

@gov.nasa.jpl.honeycomb/tag-tracker

v0.0.6

Published

Class for adding, tracking, and querying objects with associated tags.

Readme

tag-tracker

Manager for associating tags with objects and quickly querying objects that match a set of tags or boolean operations with tags.

Use

import { TagTracker, compileExpression } from '@gov.nasa.jpl.honeycomb/tag-tracker';

// Add tags
const objA = {};
const objB = {};
tagTracker.addTag(objA, ['tag-a', 'tab-b']);
tagTracker.addTag(objB, ['tag-b', 'tab-c']);

// Get the objects with the given tags
tagTracker.getObjects('tag-b && !tag-c');

// or

const expr = compileExpression('tag-b && !tag-c');
tagTracker.getObjects(expr);

API

Functions

compileExpression

compileExpression( expression : String ) : Function

Prebuilds the expression evaluation function to use with the getObjects function. This can be faster than building the function on the fly.

TagTracker

Class for adding, tracking, and querying sets of tags on objects.

extends EventDispatcher

addTag

addTag( obj : Object, tag : String | Array<String> ) : Boolean

Associates a tag or set of tags with an object.

Returns true for a tag if it was added successfully or false if the tag was already associated with an object.

!> Tags cannot contain character that may be included in an expression or white, including !, &, <, >, |, =, or ~.

removeTag

removeTag( obj : Object, tag : String | Array<String> ) : Boolean

Removes a tag or st of tags from an object.

Returns true for a tag if it was removed successfully or false if the tag wasn't already associated with an object.

hasTag

hasTag( obj : Object, tag : String ) : Boolean

Returns true if the object has the given tag.

filter

filter(
	obj : Object | Array<Object>, 
	tagOrExp : String | Function, 
	flatten : Boolean = false
) : Array<Object>

Filters the given tree of objects to a flattened list of objects if flatten is true. obj is expected to have an array of children on it if flatten is true.

Returns the filtered result.

getObjects

getObjects( tagOrExp : String | Function ) : Array<Object> | null

Returns the set of objects that matches the given tag or expression. An expression may be a string or pre-compoiled expression function. For example:

tracker.getObjects('tag-a && tag-b && !tag-c || tag-d');

If the expression is null then all objects are returned.

getTags

getTags( obj : Object ) : Array<String>

Returns the set of tags associated with an object. Returns null if there are no tags.

removeObject

removeObject( obj : Object ) : void

Remove an object an all associated tags from the tracker.

getAllTags

getAllTags(  ) : Array<String>

Returns an array of all currently tracked tag names