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

@adamfrostt/bill-acceptor

v0.1.0

Published

Bill Acceptor

Downloads

2

Readme

Bill Acceptor

Setup and running

Install node v12.13.x (MUST be v12.13.x otherwise serial library will cause an error) [https://scotch.io/@vishalbiradar/how-to-install-specific-version-of-nodejs]

Also serial library must be installed with sudo and globally. Use sudo npm install -g serialport --unsafe-perm in order to circumvent the errors that can (and will) appear.

Install all npm dependencies with sudo npm install

Run witn sudo node srv-proto.js

Must be used with sudo because of serial/USB device access

Session is started by POST /api/init on localhost:8081 (port can be changed in config.js) The POST json is the same that the init service on the backend returns (i.e. After it is executed on backend, it should automatically call node's /api/init, but for testing we trigger it via postman manually)

Then the 60 sec session is started and within that period the money can be inserted It will automatically call callbackCashPayIn and callbackCashPaymentConfirm on the backend (as defined in init call) every time the money is inserted successfully (if it is not rejected by the acceptor, in which case we may log the error but the session continues to count down where it left off)

The session is reset to default (60 sec) every time a new bill is inserted

To get the amount use /api/get/current/amount which also returns the remaining session time In case of an error 'expired session' a call to finish session should be made from the site

The inserted bills are all stored in the session

The session is returned when called /api/finish/session together with all inserted banknotes' data and the amount

Logs are being placed in the apps directory in form bill-acceptor.YYYY-MM-DD.log Old logs are zipped. Logs older than 30 days (can be changed in config.js are automatically deleted).

Running The Compiled Version

The compiled version is provided in executable form for linux (bin/app). config.js MUST be placed in the same directory where the executable is, otherwise it won't work. Then just run with sudo ./app from the app's folder.

In case of the changes a new compiled version can be made by installing pkg package (sudo npm i -g pkg) on a system where the code can run (all npm dependencies present etc), and then compiling with sudo pkg --targets=linux app.js from the app folder. It will complain about the path for config.js but that can be ignored as it will be placed in the same folder.

List of Required npm Libraries:

  • encrypted-smiley-secure-protocol
  • express
  • body-parser
  • moment
  • hashmap
  • request
  • winston
  • winston-daily-rotate-file