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

serial-at

v0.0.4

Published

Library to execute AT commands with node.js

Downloads

53

Readme

Description

Very simple library to execute AT commands in node.js. Uses Promises.

It uses serialport node package under the hood, so it is crossplatform and could be used in both linux and windows.

Installation

You can install it with this command:

npm install serial-at

Usage

Usage is very simple (in example below we use async/await interface instead of plain promises):

'use strict';

// require lib
const Port = require('serial-at');

(async function main() {
    // create serial connection
    const port = new Port({path:'/dev/ttyUSB3'});

    // open serial connection
    await port.open();

    // execute AT command and diaplay result
    console.log(await port.at('AT'));

    // close serial connection
    await port.close();
})();

All asynchronous functions in this library return Promises.

Documentation

Port

Class serves connection to radio-module, sends AT-commands and receives answers.

constructor (options)

Create new Port object with given options.

Parameters

options Key-value object with options to use in serial connection and when sendining AT commands.

path [required] Serial interface path (COM-port name), e.g. /dev/ttyUSB3 or COM3.

Awailable options are:

dataBits [optional, default: 8] Must be one of these: 8, 7, 6, or 5.

stopBits [optional, default: 1] Must be one of these: 1 or 2.

parity [optional, default: 'none'] Must be one of these: 'none', 'even', 'mark', 'odd', 'space'.

baudRate [optional, default: 115200] The baud rate of the port to be opened. This should match one of the commonly available baud rates, such as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, or 115200. Custom rates are supported best effort per platform. The device connected to the serial port is not guaranteed to support the requested baud rate, even if the port itself supports that baud rate.

line_end [optional, default: '\r\n'] Line termination symbols to send after AT command. Commonly used CRLF ('\r\n') line end, but some devices could support also LF ('\n') line end.

read_time [optional, default: 1000] Time to wait after AT command send before reading answer in milliseconds. Increase this time if you do not get complete answers from serial port.

open()

Opens a connection to the given serial port. Returns Promise.

close()

Closes the opened connection. Returns Promise.

at(command)

Sends AT-command and reads an answer. Returns Promise.

Parameters

command AT command to execute without line termination symbols.

Example:

// execute AT command and diaplay result
port
    // send AT command
    // note that we do not need to send 'AT\r\n'
    .at('AT')

    // get result of AT command execution
    .then(result => {
        console.log(result);
    })

    // handle possible errors
    .catch(err => console.log(err));

@license MIT
@version 0.0.4
@author Alexander Russkiy [email protected]