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

drifter-sender

v0.1.3

Published

Send logs, telemetry, or events to drifter.

Readme

drifter-sender

Stability: 1 - Experimental

NPM version

Send messages (logs, telemetry, or events) to Drifter.

Overview

drifter-sender is a Node.js module for sending messages (logs, telemetry, or events) to Drifter. It encodes the message as a query string and issues an HTTPS GET request to the specified destination.

Usage

"use strict";

var Drifter = require('drifter-sender');

var drifter = new Drifter({
    capability: '02hAozGflu',
    hostname: 'localhost',
    path: '/1/log',
    port: 4443,
    rejectUnauthorized: false
});

// optionally listen for responses from Drifter (expect 503)
drifter.on('data', function (data) {
    console.log(data);
});

// optionally listen for errors from Drifter
drifter.on('error', function (error) {
    console.log(error);
});

// optionally listen for reported telemetry
drifter.on('telemetry', function (telemetry) {
    console.log(telemetry);
});

drifter.send("uri=encoded&data=to_send");
// GET /1/log?02hAozGflu&uri=encoded&data=to_send HTTP/1.1\r\n
// Host: localhost\r\n
// \r\n

drifter.send("service=mysql&server=db15&unit=B&value=17");
// GET /1/log?02hAozGflu&service=mysql&server=db15&unit=B&value=17 HTTP/1.1\r\n
// Host: localhost\r\n
// \r\n

Tests

npm test

Documentation

new Drifter(config)

  • config: Object (Default: undefined)
    • capability: String The capability string to use.
    • hostname: String Drifter hostname to connect to.
    • path: String Drifter path to connect to.
    • port: Number (Default: 443) Port to connect to.
    • rejectUnauthorized: Boolean (Default: true) If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails.

Creates a new Drifter sender instance.

Drifter sender communicates only via TLS.

drifter.connect()

CAUTION: reserved for internal use

Creates a TLS connection to self.hostname:self.port and sends all the messages in the buffer.

drifter.send(message)

  • message: String URI encoded data to send. For example: foo=bar, or service=mysql&server=db15&unit=B&value=17

Pushes message onto a local buffer to send to Drifter server. If a connection currently doesn't exist, it starts connecting. Once Drifter sender is connected, it sends all the messages in the buffer.

drifter.sendMessages()

CAUTION: reserved for internal use

If there are messages in the buffer, sends the message to self.hostname:self.port via HTTPS over the currently open connection. The request looks like:

GET <self.path>?<self.capability>&<message> HTTP/1.1\r\n
HOST: <self.hostname>\r\n
\r\n

If there are more messages in the buffer to send, schedules the next invocation of drifter.sendMessages() via setImmediate().

Event: data

  • function (data) {}
    • data: String Any data returned by Drifter server.

Emitted when Drifter server acknowledges receipt of a message. Expected response is an HTTP response HTTP/1.1 503 Service Unavailable with associated headers.

Event: error

  • function (error) {}
    • error: Object An error emitted by the TLS connection.
      • code: String An error code. For example ECONNREFUSED.

Emitted when the TLS connection emits an error.

Event: telemetry

  • function (telemetry) {}
    • telemetry: String A self-describing querystring encoded telemetry string.

Emitted when Drifter sender has telemetry to report. For example:

module=drifter-sender&module_version=0.0.0&target_type=timer&operation=secure_connect&unit=ns&value=3713603