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

examenopdracht-tomvanhove

v2.0.1

Published

This project is under the MIT license, you can read it here: [LICENSE.md](LICENSE.md)

Downloads

24

Readme

Temperature 7 - segment LCD Display

nmp badge

ESLint

Markdown Linter

Tests

Description

in this project, you can provide a temperature and choose if you want a border or not, in an 7 segment display style. I will show you how it works. Like it is very easy. In app.ts I made some examples.

  const temperature = new Temperature()
  temperature.setTemperature("100 °C", "small", false);
  temperature.setTemperature("123 °C", "small", true);
  temperature.setTemperature("-12756.69 °C", "small", true);
  temperature.setTemperature("-12.69 °C", "small", true);
  temperature.setTemperature("12345.6789°C", "big", false);
  temperature.setTemperature("-1234567890. °C", "big", true);
  temperature.setTemperature("126.69 °C", "big", true);

Basically you need to give 3 arguments with the setTemperature method of the Temperature class.

  setTemperature(<temperature>: string, <size>: string, <border or not>: boolean)

as you can see, the first argument is the temperature, here in a string format, because the °C is not a number. So this was the easiest way to do it. the second argument is the option to have the temperature in a big or small format. the third argument is the option if you want a border or not.

the command to run the project:

  ts-node index.ts

The result of the the statements above is:

    _  _     _  _
  || || |   |_||  
  ||_||_|      |_
 __________________
|    _  _     _  _ |
|  | _| _|   |_||  |
|  ||_  _|      |_ |
|__________________|
 ____________________________________
|       _  _  _  _     _  _     _  _ |
| _   | _|  ||_ |_    |_ |_|   |_||  |
|     ||_   | _||_| / |_| _|      |_ |
|____________________________________|
 ___________________________
|       _     _  _     _  _ |
| _   | _|   |_ |_|   |_||  |
|     ||_  / |_| _|      |_ |
|___________________________|
     __  __      __      __  __  __  __  __  __
   |   |   ||  ||       |      ||  ||  ||  ||
   | __| __||__||__     |__    ||__||__||__||
   ||      |   |   |    |  |   ||  |   |    |
   ||__  __|   | __|  / |__|   ||__| __|    |__
 ____________________________________________________________
|         __  __      __  __  __  __  __  __          __  __ |
|       |   |   ||  ||   |      ||  ||  ||  |        |  ||   |
| __    | __| __||__||__ |__    ||__||__||  |        |__||   |
|       ||      |   |   ||  |   ||  |   ||  |            |   |
|       ||__  __|   | __||__|   ||__| __||__|  /         |__ |
|____________________________________________________________|
 ____________________________________
|     __  __      __  __      __  __ |
|   |   ||       |   |  |    |  ||   |
|   | __||__     |__ |__|    |__||   |
|   ||   |  |    |  |   |        |   |
|   ||__ |__|  / |__| __|        |__ |
|____________________________________|

Like you can see, there are different types of visualization. You can choose them by providing it in de constructor above.

Unit tests

I've provide some unit test to see if the functionality is correct.

You can easily check them with following command

npm run test

this is the result

PASS  tests/digits.test.ts

Test Suites: 2 passed, 2 total
Tests:       34 passed, 34 total
Snapshots:   0 total
Time:        1.674 s, estimated 4 s

Because of working with test, the index.ts file can be deleted. The test renders the index.ts file. The tests will check if your program works fine, so you don't need to manually check if the output is correct. I let the index file where it was. Because it is a bit easier to see the results in the terminal. But if you don't want to, you're free to delete.

NPM package

npm init --scope@my-org
npm publish --access public

License

This project is under the MIT license, you can read it here: LICENSE.md

Documentation

Via following link you can find the full documentation of the library: DOCUMENTATION OF THE LIBRARY

Author information

Name: Van Hove Tom
Email: [email protected]
Role: student
School: Vives University
Location: Bruges Belgium