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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@matthiaswillem/7-segment_display

v0.3.0

Published

A TypeScript library that can display temperature data in the console in LCD style

Downloads

14

Readme

7-segment display

npm badge ESLint Markdown Linter License

Exam assignment 2020 - Software Engineering Matthias Willem

A TypeScript library that can display temperature data in the console in LCD style according to following format:

 ______________________
|   _    _        _  _ |
| | _|   _||_|   |_||  |
| ||_  / _|  |      |_ |
|______________________|

Installation

Installing the package

This package package is available on npmjs.com. Check it out!

Just run this command:

npm i @matthiaswillem/7-segment_display

Building a package

If you want to create a package yourself

Programs

Node.js

Visit website

Visual Studio Code ( Not really necessary but it is useful )

Visit website

Command line

Install npm

npm install npm@latest -g

Install typescript

npm install -g typescript

Install ts-node

npm install -g ts-node

Documentation

The documentation of the package can you find at the GitHub Pages

Examples

Here I will give you some examples for using this package. The main method is:

 display(temperature: number, frame: boolean)

In the first parameter temperature, you can give a number what the temperature should be. In the second parameter frame, you can the method you want a frame (true) or not (false).

With border

An example command

display(12.34291, true)

The output

 ________________________
|     _    _        _  _ |
|  |  _|   _||_|   |_||  |
|  | |_  / _|  |      |_ |
|________________________|

Without border

An example Command

display(6, false)

The output

  _     _  _     _  _
 |_    | || |   |_||  
 |_| / |_||_|      |_

Versions

All NPM versions are the same of the github versions tags.

0.0.0

Project Setup

Added some files:

  • README file
  • LICENCE file
  • Markdown Linter by commit
  • ES Linter Checker by commit
  • NPM Package
  • Jest test file
  • .gitIgnore file

Edited some files:

  • README
    • Added
      • Badges
        • NPM Version
        • License
        • ESLint Check
        • Markdown Check
      • Discription
      • Installation
      • Versions
      • License
      • Author information
  • display.ts
    • Added
      • Example
  • display.test.ts
    • Added
      • Example

0.1.0

Project Start - Read the temperature

Edited some files:

  • README
    • Added
      • New version (0.1.0)
  • display.ts
    • Removed
      • Example
    • Added
      • setTemp()
      • getTemp()
      • getRoundedTemp()
  • display.test.ts
    • Removed
      • Example
    • Added
      • Some tests for testing all new methods

0.1.1

Put temperature chars into array + read

Edited some files:

  • README
    • Added
      • New version (0.1.1)
  • display.ts
    • Added
      • getTempNumbArray()
      • getTempArrayValue(index: number)
      • tempToArray()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.2

Doesn't exist anymore. I removed it for a small bugfix and didn't noticed you can't ever publish the same version again after you removed one.

You can find more info here about it.

0.1.3

Array of the whole temperature

Edited some files:

  • README
    • Added
      • Version problem 0.1.2
      • New version (0.1.3)
  • display.ts
    • Added
      • getTempArray()
      • buildTempArray()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.4

Printing temperature array in one string

Edited some files:

  • README
    • Added
      • New version (0.1.4)
  • display.ts
    • Added
      • printDisplay()
  • display.test.ts
    • Added
      • Some tests for testing all new methods

0.1.5

Reworked printDisplay method Cleaner, DRY code. Removed spaces between numbers

Edited some files:

  • README
    • Added
      • New version (0.1.5)
  • display.ts
    • Modified
      • printDisplay()

0.1.6

Added everywhere default the °C symbol.

Edited some files:

  • README
    • Added
      • new version (0.1.6)
  • display.ts
    • Modified
      • buildTempArray()
      • setTemp(value: number)
  • display.test.ts
    • Modified
      • All tests added the °C symbol

0.2.0

The basics work (No Frame, no 2x Font)

Fully rebuild project:

  • Separated much methods in some other methods for the Single Responsibility Principle (SRP)
  • Changed much names of methods
  • Had to change the tests too (And remove some)
  • Added documentation

Edited some files:

  • README
    • Added
      • Documentation (GitHub Pages)
      • New minor version (0.2.0)
  • docs
    • Added docs directory for github pages
  • display.ts
    • Added
      • setTempNumb(temperature: number)
      • getTempNumb()
      • tempNumbRound()
      • temperatureAddCelcius()
      • setTemperature(temperature: number)
      • getTemperature()
      • temperatureToArray()
      • getTemperatureArray()µ
      • checkAndBuildChar(tempArrChar: number, tempChar: number)
      • buildDisplayArray()
      • getDisplayArray()
      • resetOutput()
      • resetIndentation()
      • printFirstRow()
      • printSecondAndThirdRow()
      • changeIndentation(row: number)
      • printDisplay()
    • Removed
      • setTemp(value: number)
      • getTemp()
      • getRoundedTemp()
      • getTempNumbArray()
      • getTempArrayValue(index: number)
      • tempToArray()
      • getTempArray()
      • printDisplay()
      • buildTempArray()
  • display.test.ts
    • Modified
      • All tests are modified with the correct names

0.3.0

Added the frame to the project

Edited some files:

  • README
    • Added
      • New minor version (0.3.0)
      • Examples
  • docs
    • Added
      • The new methods
  • display.ts
    • Added
      • checkBorder(border: boolean)
      • createHorBorderTop(border: boolean)
      • createHorBorderBottom(border: boolean)
      • display(temperature: number, frame: boolean)
    • modified
      • printDisplay(frame: boolean)
      • changeIndentation(row: number)
      • printFirstRow()
      • resetOutput()
      • one[] (for better layout)
  • display.test.ts
    • Added
      • 2 new tests for printDisplay(true)
      • 2 new tests for display(temperature: number, frame: boolean)

Licence

This project is licensed under the MIT License - see the LICENSE file for details

Author information

Matthias Willem

Student Electronics-ICT VIVES Bruges