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-sdk

v6.11.1

Published

File processing tools for TZ Medical's line of Trident cardiac monitors.

Downloads

508

Readme

Trident Software Development Kit

npm version npm downloads CircleCI

This repository contains a collection of programs written in C++ and Javascript to help speed development of programs for interacting with the binary files generated and consumed by TZ Medical Trident devices.

Trident File Specifications

To expedite development of software this repository also includes specifications for the File Formats used by the Trident devices, including the Actions, Events, and Settings generated and consumed by TZ Medical Trident devices. These specifications can be found at the following locations:

Use in Node.js

The programs in the repository are published as an NPM package to simplify deployment.

Javascript Usage

Each file type is encapsulated as a class, with functions for each class available according to the following table:

| File Type | toText() | fromText() | toJson() | fromJson() | find() | metaJson() | parse() | | --------- | ---------- | ------------ | ---------- | ------------ | -------- | ------------ | --------- | | tze | X | | X | X | X | | | | tzr | X | | X | X | X | | | | tza | X | X | X | X | | | | | tzs | X | X | X | X | | X | | | tzg | | | X | X | | | | | scp | X | | X | X | | | | | bak | X | X | | | | | | | error | | | X | | | | | | queue | | | | | | | X |

Here is a simple usage example for parsing an *.tze file into JSON. See the file cli.js for more detailed usage examples.

const {tze, tzr, tza, tzs, scp} = require('@tzmedical/trident-sdk');
const fs = require("fs");

function parseTze(inFile) {
  const buffer = fs.readFileSync(inFile);

  return tze.toJson(buffer)
    .then(result => {
      console.log(JSON.stringify(result));
    });
}

Command-line Usage

When installed using npm install -g @tzmedical/trident-sdk or when git cloned and linked using npm install && npm link, a cli tool is available with the following commands.

Usage: trident-sdk [options] [command]

Options:
  -V, --version                                 output the version number
  -h, --help                                    display help for command

Commands:
  toText [options] <inPath> [outPath]           Parse a binary file into a text format, based on the suffix of the file.
  fromText [options] <inPath> <outPath>         Generate a binary file from a text format, based on the suffix of the output file.
  toJson [options] <inPath> [outPath]           Parse a binary file into a JSON format, based on the suffix of the file.
  fromJson [options] <inPath> <outPath>         Generate a binary file from a JSON format, based on the suffix of the file.
  metaJson [options] <deviceType>               Output metadata for the filetype in a JSON format.
  find [options] <directory> [outPath]          Search a directory.
  parse [options] <directory> [outPath]         Find and parse wireless files into a JSON format from the tmp folder.
  retrieveFile [options] <directory> <outPath>  Find an SCP file in a directory given a sequence number.
  help [command]                                display help for command

Each command will try to automatically detect the file format based on file suffixes, but this detection can also be overridden with an options flag as shown below:

Usage: trident-sdk toText [options] <inFile> [outFile]

Parse a binary file into a text format, based on the suffix of the file.

Options:
  -f, --format <type>        the format of file to parse: tze, tzr, tza, tzs, scp, or bak
  -e, --epoch-ms <offset>    the starting ms epoch for HR calculations in tzr files
  -t, --tag <tag>            event tag number to search for in tzr or tze files
  --skip-crc                 ignore the crc value in the file and print the parsing results
  --no-file-header           don't print out the file header, just the entries
  --device-type <device>     type of device that created this backup file
  -h, --help                 display help for command

Contributing

To contribute to this NPM package, you will need Python 3.7 or later available on your system before installing. For Windows PCs, we recommend installing Node.js LTS. When asked if you would like to install build tools, select yes to ensure the required dependencies are also installed.

When developing in VS Code, add the following line to your settings file to make include warnings from Intellisense go away:

{
  "local.node-gyp.node-cache": "C:/Users/<UserName>/AppData/Local/node-gyp/Cache/<NodeVersion>"
}

Standalone Executables

It is also possible to build standalone executables for each of the programs by cloning the repository and then running the shell script scripts/compile.sh. Running this script will require the use of bash, make, and clang. In general, it is usually preferable to use the CLI executable provided by the Node.js packaging system, rather than compiling standalone executables.