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

sevn

v1.1.2

Published

A lightweight module to manipulate a 7-Segment-Display with Raspberry Pi

Readme

Sevn

A lightweight module to manipulate a 7-Segment-Display with Raspberry Pi.

Contents

Changelog

Sevn v1.1.0

Sevn v1.1.0 adds support for the alphabetical characters: a, b, c, d, e, f, h, i, j, l, n, o, p, q, r, s, u, y and z.

Installation

npm install sevn

Note that although it's possible to install Sevn on non-Linux systems the functionality offered by the dependency "onoff" is only available on Linux systems.

Usage

A simple 7-Segment Display

Assume that a 7-Segment Display is connected to the GPIO pins: 6, 5, 13, 19, 26, 21, 20 and 16 in the alphabetical order: a, b, c, d, e, f, g, dp:

When the script is executed we want to display a 2 on the display:

const Sevn = require('sevn');
                        // a  b  c   d   e   f   g   dp
const mySegment = new Sevn(6, 5, 13, 19, 26, 21, 20, 16);

mySegment.write(2);

Here we require the sevn module and create a new segment where we pass in the respected GPIO pins in alphabetical order.

After everything has been setup. One can just call the write method with a value of 2 to write to the 7-Segment Display.

The above program will quit after running the code. However, it doesn't free its resources. Here's a slightly modified variant of the program that only quits on ctrl-c. It works by setting an interval that will fire approximately every 12 days to simulate a process. The resources used by the 7-Segment Display are released by invoking their unexport method and by setting their OUTPUT to low on pressing ctrl-c.

const Sevn = require('sevn');
                        // a  b  c   d   e   f   g   dp
const mySegment = new Sevn(6, 5, 13, 19, 26, 21, 20, 16);

mySegment.write(2);

// Keep application running
setInterval(() => {}, 1 << 30);

process.on('SIGINT', () => {

  mySegment.unexport();
  process.exit();

});

The unexport() method has to be used to make sure the used resources are freed when finishing the process.

API

write(value)

Write a value between 0 and 9 to the 7-Segment Display.

Sevn does not yet support alphanumerical letters.

unexport()

Sets GPIO output to low and unexports all used GPIO pins.

Additional Information

Sevn makes use of the "onoff" module.