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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@garmingo/status-js

v1.1.0

Published

Garmingo Status API Wrapper written for NodeJS

Downloads

146

Readme

Garmingo Status JS-SDK

Tests Workflow SonarQube Analysis

This is the official Garmingo Status JS-SDK. It allows you to easily integrate the Garmingo Status into your website or Node.js application. It fully supports the Garmingo Status API spec (described here) and provides a simple and easy-to-use interface to interact with the Garmingo Status.

Please note that this library is very opinionated and follows a strict error-free/non-throwing approach. This means that the library should never throw an error, but instead return an object with a success property set to either true or false. This allows you to easily check if an error occurred and handle it accordingly, without wrapping every call in a try-catch block.

Structure

When planning/structuring this library we wanted it to be as simple and self-explanatory as possible. Therefore, we decided to split the library into three main parts:

  1. monitors
  2. incidents
  3. events

Each part is responsible for a different aspect of the Garmingo Status and provides a set of methods to interact with it. These methods all follow a CRUD-first approach, meaning that they follow the Create, Read, Update, Delete pattern when possible and only provide additional methods if necessary, with those having self-explanatory names as well.

Installation

To install the Garmingo Status JS-SDK, simply run the following command in your terminal:

npm install @garmingo/status-js

Usage

To use the Garmingo Status JS-SDK, you first need to import it into your project:

import { Status } from '@garmingo/status-js';

Then, you can create a new instance of the Status class and start interacting with the Garmingo Status:

const status = new Status(process.env.STATUS_API_KEY);

To access the functions of the monitors, incidents or events part, simply call the respective method on the status object:

const monitors = status.monitors.getAll(); // Get a list of all monitors
const monitor = status.monitors.get('monitor-id'); // Get a specific monitor
...

const incidents = status.incidents.getAll(); // Get a list of all incidents
const incident = status.incidents.get('incident-id'); // Get a specific incident
...

const event = status.events.create({
    // Event properties
    ...
}); // Create a new event
...

Documentation

For a detailed documentation of the Garmingo Status JS-SDK, please refer to the official documentation. For a more general overview of the Garmingo Status API, please refer to the API introduction.

TypeScript

This library is written in TypeScript and fully supports TypeScript out of the box.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Contributing

Even though this library is maintained by Garmingo itself, we are always open to contributions from the community. If you have any suggestions, improvements or bug fixes, feel free to open a pull request or issue on GitHub.