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

@tzmedical/trident-server

v2.2.1

Published

Example server for receiving data from TZ Medical's line of Trident cardiac monitors.

Downloads

13

Readme

Trident Server

npm version Docker Version node version fastify version

CircleCI npm downloads Docker Pulls

This repository contains an example Node.js server designed to receive and process data uploaded from TZ Medical's Trident line of cardiac monitors.

Deployment

This server application can be deployed several different ways depending on your requirements. It can be run directly as an npm package, or it can be pulled as a docker image and run in any environment that supports containers. There is also a helm chart is available for kubernetes deployments.

Node.js

To run the server as an npm package, you can do one of the following:

# Install the package globally
npm i -g @tzmedical/trident-server
# Start the server on port 80
trident-server start -p 80

### OR ###

# Run the server using npx at the default port (3000)
npx @tzmedical/trident-server start

Docker

A docker image containing this server application is available on Docker Hub at tzmedical/trident-server. It can be pulled using the following command:

# Pull the application Docker image
docker pull tzmedical/trident-server

Helm

The Helm chart is available from Google Cloud Storage. To use it to install the server in your cluster, use the following commands to install as my-trident-server:

# Add the repository
helm repo add trident-server https://storage.googleapis.com/trident-server
# Install the chart
helm install my-trident-server trident-server/trident-server

Configuration

The following configuration options are available as either cli flags or environment variables:

| CLI flag | Environment Variable | Helm Chart | Default | Description | | ----------------------- | -------------------------------- | ---------------------- | ------------------------------ | ------------------------------------------------------- | | -p, --port | NODE_PORT | service.port | 80 | Sets the port for the application to listen on | | --post | FORWARDING_URL_LIST | forwardingUrls | [] | Sets a list of URLs to POST the parsed file contents to | | | FORWARDING_TIMEOUT_MS | forwardingTimeoutMs | 30000 | Sets the timeout for forwarding POST requests | | --redis-master | REDIS_MASTER_HOST | -automatic- | '' | Sets the hostname for the Redis master instance | | --redis-replicas | REDIS_REPLICAS_HOST | -automatic- | '' | Sets the hostname for the Redis replicas | | --redis-password | REDIS_PASSWORD | -automatic- | '' | Sets the password | | --log-level | LOG_LEVEL | logLevel | 'info' | Sets the logging level for the application server | | --pretty-logs | PRETTY_FORMAT_LOGS | prettyLogs | false | Set to use pretty-print formatting for logs | | --pubsub-enabled | PUBSUB_ENABLED | pubsub.enabled | '' | Set to enable use of google-pubsub | | --pubsub-received | PUBSUB_RECEIVED_TOPIC | pubsub.receivedTopic | trident-server-file-received | Set to override the default topic name | | --pubsub-actions | PUBSUB_ACTIONS_TOPIC | pubsub.actionsTopic | trident-server-actions-queue | Set to override the default topic name | | --pubsub-subscription | PUBSUB_SUBSCRIPTION | pubsub.subscription | trident-server-actions-queue | Set to override the default subscription name | | | GOOGLE_APPLICATION_CREDENTIALS | googleCredentials | | Set to provide Google application credentials |

Development

When developing and testing locally, a Redis server is needed. This is also required for npm test to succeed, as it expects to find a Redis instance on the default port at localhost. There are a number of options to achieve this.

  • Memurai Developer (Windows): The official Windows version requires WSL and is complicated to install. Instead, Memurai can be quickly installed via chocolatey. By default, it creates a Windows service so you can be up and running quickly.
  • Official Redis Sever (Linux): On Linux, the redis server can be installed using apt-get relatively easily.
  • Using a Docker Container (Any): There is a Redis image available on Docker Hub that can be used as well. This is what our automated testing uses.

Local testing also requires an emulator for Google's pubsub service. This can be installed with the following commands:

gcloud components install beta pubsub-emulator --quiet
gcloud components update --quiet