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

temperature-segmenter-michieldecoster

v1.0.0

Published

Temperature Segmenter

Readme

Segmenter

ESLint

Markdown Linter

Tests

Description

This is a repository for printing Temperatures in LCD Display format.

Its developed in typescript and uses npm package manager to install.

7-Segment Display

7-segemnt display image

The 7-Segment display is built with the segments A through G.

I used these with a boolean function to either show them on or off (true or false).

Example:

case 0 : {this.a=true; this.b=true; this.c=true; this.d=true; this.e=true; this.f=true; this.g=false; break}

This would return a 0 on the display.

Installation instructions

NPM Install

Usage instructions

Different values

These are the different values you can give to the DrawSegment and DrawBigSegment Classes.

case 0 : draws the number '0'
case 1 : draws the number '1'
case 2 : draws the number '2'
case 3 : draws the number '3'
case 4 : draws the number '4'
case 5 : draws the number '5'
case 6 : draws the number '6'
case 7 : draws the number '7'
case 8 : draws the number '8'
case 9 : draws the number '9'
case 10 : draws Degrees sign
case 11 : draws Celsius sign
case 12 : draws Minus sign

I got the idea to use a switch statement by finding the repository from SK-SpeedBit

Using the DrawSegments Class

This class draws the segments for the numbers depending on the number you enter into the constructor. It utilizes the cases above.

import DrawSegment from './DrawSegment'

const segment = new DrawSegment(0); // We give a 0 to the constructor to let it know we want a 0 printed

segment.print(); // Using the .print() function we tell the segment to print to the console.

Using the DrawBigSegments Class

This class is using the same functionality as the DrawSegment Class.

The Class also prints the number you request but with double the segments. Also uses the same switch case.

import DrawBigSegment from './DrawBigSegment'

const segment = new DrawBigSegment(0);

segment.print();

Using the DrawTemperature Class

import DrawTemperature from './DrawTemperature'

const temperature = new DrawTemperature(8.2);
temperature.printToConsole();
temperature.return();
The temperature.printToConsole();

Prints the temperature to the console in your web-browser.

temperature.return();

Returns the temperature as a string so it can be used in other methods.

Using the DrawBigTemperature Class

Same functionality of the DrawTemperature Class with the exception of the numbers being double size.

import DrawBigTemperature from 'DrawBigTemperature'

const bigTemperature = new DrawBigTemperature(-5.3);

bigtemperature.printToConsole(); // To print to console

bitemperature.return(); // To return as a string.

Running the coded tests

npm run test

Runs the coded tetst that have been programmed using Jest.

Jest is a JavaScript Testing Framework that also supports the tests for TypeScript.

Licence

MIT

Github Pages

Through TypeDoc we setup Github Pages. This is automatically generated documentation for your Typescript Project.

The link for the Github Pages for this repository: Github Pages

Author information

Author: Michiel Decoster

Student at Vives Hogeschool Brugge