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

@doxteam/reference-data

v0.9.0

Published

Reference data module

Downloads

69

Readme

reference-data

Helps lookup reference data.

API

init

Must be called before using to initialize data for the current context.

Parameters:

  • data - the reference data object to use.
  • contextId: {id: string}|{name: string} (optional, defaults to { name: "Master" }) - an identifier specifying the context.

Can throw an error if an invalid contextId is provided.

initFromFile

Equivalent to init(), only gets the data from a JSON file that is provided by path. Async.

initFromS3

Equivalent to initFromFile(), only gets the JSON file from Amazon S3. Async.

Parameters:

  • bucket - the S3 bucket that the file is in.
  • key - the key (i.e. file name).
  • contextId: {id: string}|{name: string} (optional, defaults to { name: "Master" }) - an identifier specifying the context.

Can throw an error if an invalid contextId is provided or if the file does not exist.

isInitialized

Determines whether reference data has been initialized.

lookup

Gets a value.

Parameters:

  • domainId: {id: string}|{referenceId: string}|{logicalName: string}|{technicalName: string} - an identifier specifying the domain of the value.
  • serviceName - the name of the service.
  • valueReferenceId - the reference ID of the value to get.

Can throw an error if no such domain, service or value exists.

reverseLookup

Gets a reference value based on a value from another service.

Parameters:

  • domainId: {id: string}|{referenceId: string}|{logicalName: string}|{technicalName: string} - an identifier specifying the domain of the value.
  • serviceName - the name of the service.
  • value - the value to check.

Can throw an error if no such domain or service exists, if the specified value could not be found, or if there are multiple matches for the value.

reverseValueLookup

Gets a base value based on a value from another service.

Parameters:

  • domainId: {id: string}|{referenceId: string}|{logicalName: string}|{technicalName: string} - an identifier specifying the domain of the value.
  • serviceName - the name of the service.
  • value - the value to check.

Can throw an error if no such domain or service exists, if the specified value could not be found, or if there are multiple matches for the value.

getReferenceIdByValueName

Gets a reference ID based on a value name.

Parameters:

  • domainId: {id: string}|{referenceId: string}|{logicalName: string}|{technicalName: string} - an identifier specifying the domain of the value.
  • valueName - the name of the value.

Can throw an error if no such domain exists or if the specified value could not be found.

getValueByReferenceId

Gets a base value by reference ID.

Parameters:

  • referenceId - the reference ID of the value to get.

Returns undefined if the specified value is not found.

getDomainReferenceIds

Gets all reference IDs for a domain.

Parameters:

  • domainId: {id: string}|{referenceId: string}|{logicalName: string}|{technicalName: string} - an identifier specifying the domain.

Can throw an error if no such domain exists.