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

@niels-vanhove/examenopdracht-nielsvanhove

v0.0.1

Published

Examen opdracht

Downloads

1

Readme

Temperature LCD Display Library

badge

ESLint

Markdown Linter

Tests

Description

This is a Typescript library that puts the values of the temperature in the console in LCD style. You can add number from 0 until 9, you can give negative numbers just add the - character before the numbers. There is also a letter C and ° included so you can give in degrees celsius. You can also give in a comma number.

Features

I added some features in the library so you can choose between normal digits or big digits.

      _  _     _  _  _  _  _   _          _    _
 _  | _| _||_||_ |_   ||_||_| | |        |_|  |
    ||_  _|  | _||_|  ||_| _| |_|  /          |_
 __      __  __      __  __  __  __  __      __  __      __  __
|  |   |   |   ||  ||   |      ||  ||  |       |   |    |  ||
|  |   | __| __||__||__ |__    ||__||__|     __| __|    |__||
|  |   ||      |   |   ||  |   ||  |   |  /    |   |        |
|__|   ||__  __|   | __||__|   ||__| __| /   __| __|        |__

Choosing between normal and big letters is one feature i added another feature so that you can wrap the digits into an framework.

 ________________________________________________
| _     _  _     _  _  _  _  _     _  _     _  _ |
|| |  | _| _||_||_ |_   ||_||_|    _| _|   |_||  |
||_|  ||_  _|  | _||_|  ||_| _| /  _| _|      |_ |
|________________________________________________|
 ________________________________________________________________
| __      __  __      __  __  __  __  __      __  __      __  __ |
||  |   |   |   ||  ||   |      ||  ||  |       |   |    |  ||   |
||  |   | __| __||__||__ |__    ||__||__|     __| __|    |__||   |
||  |   ||      |   |   ||  |   ||  |   |  /    |   |        |   |
||__|   ||__  __|   | __||__|   ||__| __| /   __| __|        |__ |
|________________________________________________________________|

How to use the library

If you want to use the library you have to delete the index.ts file. This file is still in the code so that you can test if my library works. You can just type this command in the console:

ts-node ./index.ts

If you have done testing the library you can change the value of the temperature, you can choose between big letters and normal. Or you can choose te get a framework around the digits. In the class app you can change this 3 lines of code:

const temperature = "26,33 °C"
const bigLetters = true
const framework = true

So if you want 20 °C just change the temperature variable. If you want big letters put the variable bigLetters on true if it is false you will get normal letters. If you want a framework just put the variable framework on true, if it is false you will get no framework.

Unit tests

If you don't want to use the index.ts to test the code you can also use the unit testers i made. If you want to test the unit testers just type these commando's:

npm install --save-dev @types/jest jest ts-jest
npm run test

Here is an example of an test, this test converts the binary presentation of number of 0 into digital characters.

test('converting binary small 0 code to digit', () => {
    const binaryDigit = new BinaryToDigit("11111100")
    expect(binaryDigit.letter).toStrictEqual([" _ ", "| |", "|_|"]);
})

I was not able get the output from the test in a visable digit, so i it remains in the array. But you can see that if you write all the elements of the array beneeth each other you can see the digit 0.

 _
| |
|_|

I did this for all my tests. If you test the framework you will just see a big underscore before and after the array but in the console it will be on the full lenth of te digits.

License

I added a license with the license that i use. This license is open source, oes not state that changes to the code must be documented. Derived work must not published under the same license (any licence can be used). So i have chosen for the MIT license.

  1. MIT
    • Permissions
      • Commercial use
      • Distribution
      • Modification
      • Patent use
      • Private use
    • Conditions
      • License and copyright notice
    • Limitations
      • Liability
      • Warranty

Using NPM Package

You can find my library also on npmjs.org so that you can integrate my library in projects.

Link to webiste

linkWebsite

Links that i used to build my library

These are the links that helped me build the library, i build the code by myself but i got inspiration of these links.

Author information

Author: Niels Vanhove E-mail: [email protected] School: VIVES Brugge