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

neris-api

v1.0.17

Published

typescript-based NERIS API based on its OpenAPI definition

Readme

neris-api

A typescript-based NERIS API client based on its OpenAPI definition

Usage

  • FIRST: npm install neris-api --save-dev
  • Sample #1:
// ACCESS NERIS API
import { createNerisClient } from 'neris-api';

// SET THESE BEFORE CALLING NERIS APIs:
const useSandbox = true;
const nerisAPIUrl = useSandbox ? "https://api-test.neris.fsri.org/v1" 
    : "https://api.neris.fsri.org/v1";
const authClientId = "your-integration-generated-client-id-here";
const authClientSecret "your-integration-generated-client-secret-here";

// fire dept id whose data your app will access:
const neris_id_entity = 'FD12345678'; 

// Create access to NERIS
const client = createNerisClient({
    baseUrl: nerisAPIUrl,
    auth: {
        _type: 'client_credentials',
        client_id: authClientId,
        client_secret: authClientSecret
    }
});

// Typical use of the API
const { data, error } = await client.GET(`/incident`, { 
    params: { query: { neris_id_entity } }, });
error ? console.log('ERROR:', error) 
    : console.log(JSON.stringify(data, null, 2));
  • Sample #2 (node script):
#!/usr/bin/env npx tsx

import { createNerisClient } from 'neris-api'

import { readFileSync as read } from 'node:fs';
const log = (...args: any[]) => console.log(...args);
const getCfg = (filename: string) => JSON.parse(read(filename
            .replace('~', process.env.HOME!), `utf8`));

// IMPORTANT: MUST BE SET BEFORE CALLING NERIS APIs:
const { nerisAPIUrl, authClientId, authClientSecret } 
        = getCfg(`~/.your-config-file-here`);

// get fire dept id as command line arg
const [execPath, scriptPath, neris_id_entity] = process.argv;

if (neris_id_entity) {
    const client = createNerisClient({
        baseUrl: nerisAPIUrl,
        auth: {
            _type: 'client_credentials',
            client_id: authClientId,
            client_secret: authClientSecret
        }
    });

    const { data, error } = await client.GET(`/incident`, {
        params: { query: { neris_id_entity } },
    });

    error ? log('ERROR:', error) : log(JSON.stringify(data, null, 2));
}
else {
    log('required entity ID arg missing');
}

Build Process

  • api-src is downloaded (on build) from its github repo
    • skipping .test files (e.g. auth.test.ts, client.test.ts)
  • NERIS openAPI definitions are downloaded on each build
    • BUT NOT CURRENTLY USED because there's an error building with them (as of Dec 15 2025)
    • I corrected for that error (sort-of: I removed the offending section, a quite minimal bit) and saved this "corrected" version in the neris-openapi/defs folder

References

Important links for OpenAPI

TODO: add more details on process and usage

  • must run BUILD step before can TEST api
  • expects a CONFIG object (e.g. from a json file) file to contain NERIS Integration Authentication Settings BEFORE calling createNerisClient
    • for testing, we saved ours in ~/.rrvfc file as follows:
    {
        "fdId": "FD12345678", // our own fd for safekeeping
        "nerisAPIUrl": "https://api-test.neris.fsri.org/v1",
        "authClientId": "your-authentication-client-ID-here!",
        "authClientSecret": "your-authentication-client-secret-here!"
    }

To Create An Integration (NERIS-speak for an app that can access NERIS DB)

  • GOTO: https://test.neris.fsri.org/admin/integrations?entity=FD12345678 (with your actual fire dept ID)

    • NOTE: link above seems to be NOT BE EXPLICITLY on dashboard (so must be MANUALLY pointed to: i.e. .../integrations?...)
    • NOTE: link above includes test. prefix but there is ALSO one for when you're ready for production (minus the test. prefix obvioulsy)
  • THEN: click Create Integration

  • THEN: NAME IT (e.g. "RRVFC NERIS Helper")

  • THEN: COPY Client ID/Secret and SAVE IT SOMEWHERE (but NOT on a git/npm-repo!)

    • this is the ONLY TIME YOUR SECRET WILL BE VISIBLE
  • fdId is your CLIENT's Fire Dept (entity) ID that allows YOUR integration to access their data:

    • client does so by ENROLLING your integration (e.g. RRVFC Neris Helper) in their dashboard
    • their dashboard link: https://neris.fsri.org/admin/enrollments?entity=FD12345678
      • where entity (above) is their fdId
    • A dept MUST enroll an integration before that the integration is allowed to access its (dept) data
      • they do so using YOUR integration's generated authClientId (from above)
        • DO NOT GIVE THEM YOUR CLIENT SECRET: that's just for YOUR code to use when making API calls about their data

NERIS Admin Links