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

ellipsis-com

v0.1.1

Published

For the management of serial communication based on commands and responses defined by regular expressions.

Downloads

302

Readme

ellipsis-com

Serial communication management with command/response macros defined by regular expressions. The library wraps a serial port, executes macros, and exposes a manager for discovering and interacting with devices.

Features

  • Connect to serial ports with a configured baud rate
  • Send command macros and wait for regex-matched responses
  • Manage multiple devices via a central manager

Install

npm install

Build

npm run build

Test

npm test

Basic usage

import { ComManager } from 'ellipsis-com'
import { ComMacro } from 'ellipsis-com'

/**
 * This demo works with the arduino-demo sketch.
 */
async function demo() {
    const manager = new ComManager()

    // Initialise the manager with a com type that has some macros.
    // The init macro is required and is used to identify the type of a port when it is connected. 
    // The other macros are optional and can be used to define commands that can be sent to the device.
    await manager.init(
        [{
            name: 'myType',
            baud: 9600,
            startupDelay: 2000, // optional delay to wait for device to startup after connecting and before sending init
            macros: {
                // Command to initialise and identify type - must have key 'init':
                init: [new ComMacro('INFO', /MOCK\sDEVICE\sV\d+.?\d*[\n\r]+STATUS: OK[\n\r]+CMD DONE$/gm)], // regex to identify device as being of myType

                // Basic command and response pattern - can be named anything:
                getData: [new ComMacro('GET DATA', /CMD DONE$/gm)],

                // Command with parameters:
                setData: [new ComMacro('SET DATA {val}', /CMD DONE$/gm)],

                // Command with a sequence of commands and responses:
                deleteData: [
                    new ComMacro('DEL DATA', /Are you sure\? \(Y\/N\)$/gm),
                    new ComMacro('Y', /CMD DONE$/gm)
                ]
            }
        }]
    )

    // Send the getData command to the first port of type 'myType':
    let data = await manager.send('myType', 0, 'getData')
    console.log('\nGet data response - ', data[0], '\n') // data is an array of responses matching the regex for the macro

    // Send the setData command with a parameter:
    await manager.send('myType', 0, 'setData', {val: 'abc123'})
    data = await manager.send('myType', 0, 'getData')
    console.log('\nData changed - ', data[0], '\n')

    // Delete the data using the deleteData command which has a sequence of commands and responses:
    await manager.send('myType', 0, 'deleteData')
    data = await manager.send('myType', 0, 'getData')
    console.log('\nAfter deletion - ', data[0], '\n')
}

demo()

Project structure

  • src/ComPort.ts: serial port wrapper with read/write/macro support
  • src/ComType.ts: device type definition and macro configuration
  • src/ComMacro.ts: command/response macro definition
  • src/ComManager.ts: device discovery and access by type

License

ISC