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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tysonalcorn/est-helpers

v1.0.0

Published

Helpers for EST device data

Readme

est-helpers

Helpers for EST device data. Work in progress.

Table of Contents

Usage

Devices

import {Devices} from '@tysonalcorn/est-helpers';

/*
logic to extract device data from EST report
...
let devices = data
*/
let config = {
    restartLoopsAfterPanel: true, // resets loop to 1 for each panel; loops are numbered consecutively by panel and then card otherwise
    continuousAddressing: false, //if true, device addressing continues after each loop, even if on different cards (i.e. loop 3 would start with device 501)
    separateAddressing: true, //restart device numbering after each loop, even if on the same card
    facp: 'est3' //or 'io'; type of panel being used
};

const deviceSetter = new Devices(devices, config);

let loops = deviceSetter().getLoops(); //returns array with loop data

/*
logic to allow user to edit loop numbers if necessary to match fire alarm drawings
...
*/

//to merge devices with existing device data
devices = deviceSetter().setLoops(loops).merge(oldDevices);

//without merging with existing device data
devices = deviceSetter().setLoops(loops).init(); //returns array of device objects with loop data included

Without editing loops:

import {Devices} from '@tysonalcorn/est-helpers';

/*
logic to extract device data from EST report
...
let devices = data
*/
let config = {
    restartLoopsAfterPanel: true, // resets loop to 1 for each panel; loops are numbered consecutively by panel and then card otherwise
    continuousAddressing: false, //if true, device addressing continues after each loop, even if on different cards (i.e. loop 3 would start with device 501)
    separateAddressing: true, //restart device numbering after each loop, even if on the same card. Will restart after panel if restartLoopsAfterPanel is true
    facp: 'est3' //or 'io'; type of panel being used
};

const deviceSetter = new Devices(devices, config);

//to merge devices with existing device data
devices = deviceSetter().merge(oldDevices);

//without merging with existing device data
devices = deviceSetter().init();

Return Values

Loop Data
[
    {
        panelCard: '0102',
        panel: 1,
        card: 2,
        loop1: 1,
        loop2: 2,
        loops: [1,2]
    }
]
Device Data
EST3
[
    {
    panelName: 'FACP',
    label: 'SD_1_DLR',
    panel: 1,
    card: 2,
    address: 1,
    message1: 'SMOKE DETECTOR L1D1',
    message2: 'AT FACP',
    model: 'PS',
    barcode: '3902009904',
    logicalAddress: '01020001',
    type: 'SMOKE',
    deviceType: '12',
    scanned: true,
    dualModule: false,
    secondPort: false,
    loop: 1,
    alias: {},
    custom: {},
    shortName: 'Smoke',
    message: 'SMOKE DETECTOR L1D1 AT FACP'
  }
]
IO
[
    {
        panel: 1,
        card: 2,
        address: 1,
        message1: 'SMOKE DETECTOR L1D1',
        message2: 'ABOVE FACP',
        model: 'PS',
        barcode: null,
        type: 'Smoke',
        deviceType: '12',
        scanned: false,
        dualModule: false,
        secondPort: false,
        loop: 1,
        alias: {},
        custom: {},
        shortName: 'Smoke',
        message: 'SMOKE DETECTOR L1D1 ABOVE FACP'
    }
]

Create Dialer Strings

import {Devices, createDialerStrings} from '@tysonalcorn/est-helpers';

/*
logic to extract device data from EST report and accept user input
...
let devices = data
*/
let config = {
    restartLoopsAfterPanel: true,
    continuousAddressing: false,
    separateAddressing: true,
    facp: 'est3'
};

const defaultStrings = ['trouble, sup, alarm'], defaultPartition = '01', defaultZone = '001';

const deviceSetter = new Devices(devices, config);
devices = deviceSetter().init();
const dialerStrings = createDialerStrings(devices, matchLabel, modcomLabel, defaultStrings, defaultPartition, defaultZone); //[{input: '', output: ''}...]

Inputs

devices: Array of device objects with loop data

matchLabel: User defined match string for device labels where '*' is used as a wild card, '@' is used to match the partition n-variable, and '#' is used to match the zone n-variable

  • Given the device label 'SD_ANN3_1-2', match label '*_@-#' would include the device in the dialer string input with a partition number of 1 and a zone number of 2

modcomLabel: User defined string that should be equal to the modcom label intended to be used in the 3-SDU rules

defaultStrings: Array of first event dialer strings to include by default. Can include 'trouble', 'sup', and 'alarm'

defaultPartition: User defined string that defines the partition for any first event dialer strings

defaultZone: User defined string that defines the zone for any first event dialer strings

Create N-Variable Inputs

import {Devices, createNVarInput} from '@tysonalcorn/est-helpers';

/*
logic to extract device data from EST report and accept user input
...
let devices = data
*/
let config = {
    restartLoopsAfterPanel: true,
    continuousAddressing: false,
    separateAddressing: true,
    facp: 'est3'
};

const defaultStrings = ['trouble, sup, alarm'], defaultPartition = '01', defaultZone = '001';

const deviceSetter = new Devices(devices, config);
devices = deviceSetter().init();
const nVarInputs = createNVarInput(devices, matchLabel); //[{input: ''}...]

Inputs

devices: Array of device objects with loop data

matchLabel: User defined match string for device labels where '*' is used as a wild card and '#' is used to match the n-variable

  • Given the device label 'SD_ANN3_1-2', match label '*_ANN#_*' would include '3' in the n-variable input

Constants

Device Types

Array of device type objects with the following form:

[
    {
      type: "Heat",
      value: 10,
      validBarcodes: [36, 38, 48],
      names: ["HEAT"],
      shortName: 'Heat',
      event: "ALARM",
      cid: 114
    }
]

Barcode Types

Array of objects containing data relevant to device barcodes with the following form:

[
    {
        type: 'io',
        dual: false,
        module: true,
        defaultModel: 'IO',
        value: 47,
    }
]