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

hackrf-stream

v1.0.1

Published

A stream interface to receive and transmit on a HackRF radio

Downloads

19

Readme

hackrf-stream

A stream interface to receive and transmit on a HackRF radio

npm install hackrf-stream

API

// get a list of devices
var devices = require('hackrf-stream')()
// open the first device
var radio = devices.open(0)
// create a readable stream for receiving
var rx = radio.createReadStream()
// create a writable stream for transmitting
var tx = radio.createWriteStream()

// tune to the frequency we want to send/receive on
radio.setFrequency(2.55e9)

// transmit input taken from stdin
process.stdin.pipe(tx)
// pipe received data to stdout
rx.pipe(process.stdout)

var devices = require('hackrf-stream')()

Returns an array containing information about the connected HackRF devices. If no devices are found, an empty array is returned.

var radio = devices.open(deviceIndex, [opts])

Opens the device with index deviceIndex, using the specified options (if any). Available options for opts:

  • closeOnExit - if true, the radio will automatically be closed on process.exit or SIGINT (Ctrl-C)

Note that the device will continue transmitting after your program terminates, unless you use the closeOnExit option or manually call radio.close.

radio.createReadStream()

Returns a readable stream which emits raw sample data received by the radio.

radio.createWriteStream()

Returns a writable steam for transmitting data.

The HackRF cannot transmit and receive simultaneously, so while data is being written, read streams returned by createReadStream will not emit anything.

radio.setFrequency(freq_hz, [callback])

Set the center frequency for both receiving and transmitting.

radio.setSampleRate(rate_Mhz, [callback])

Set the number of samples per second for both receiving and transmitting. The rate must be one of the following: 8, 10, 12.5, 16, 20.

radio.setBandwidth(bw_Mhz, [callback])

Set the filter bandwidth (this makes so data we receive only includes signals within a certain range of the frequency passed to setFrequency). The bandwidth must be one of the following: 1.75, 2.5, 3.5, 5, 5.5, 6, 7, 8, 9, 10, 12, 14, 15, 20, 24, 28.

radio.close([callback])

Stops receiving and transmitting, and releases the device so it may be used by other processes.

radio.device

A handle to the underlying device returned by the hackrf package. See the hackrf module's README for documentation about the device's API.