JavaScript

How does the plugin for thermal printers work

A plugin for printing in thermal printers directly from browser

In this post I will introduce to you a plugin for printing tickets, receipts or invoices on a thermal printer using client-side JavaScript even if your web page or application is on a cloud server.

This plugin allows you to print directly from browsers, without dialogs and without browsers compatibility issues because you only have to send a HTTP request to print silently and in the background.

Continue reading…

Ticket sample

Print receipt in thermal printer using JavaScript, CSS & HTML

In this post I will show you how to print a ticket or receipt by using JavaScript (client side) and a thermal printer. At the end we will have a great ticket that looks like this:

Ticket sample

Receipt printed in thermal printer using JavaScript only

Obviously you can change the font family, size, logo and so on. And remember: we will be using only pure CSS, HTML & JavaScript, no frameworks; though you can use any framework to render the content before printing.

You can see the demo here, and the full code on my GitHub.

Continue reading…

Change express-generator app port

The express-generator package helps a lot in the development of web applications with Node, because it generates the skeleton of an application.

A small disadvantage is that, when generating the code, we do not know how to change some very basic things, for example, the port on which the app listens (the default port is 3000).

In this post I will show you how to change the port in some app generated by express-generator. Continue reading…

How to install Node.js and NPM on Android using Termux app

In this post we will see how to install Node.Js and NPM (Node package manager) in Android.

At the end we will be able to run Node.js applications as if we had a Linux server.

We will also see how to install dependencies using the npm install command, since it is a possible thing in Android thanks to Termux.

Specifically we will install version 6.9.0 of NPM and version 12.3.1 of node, although perhaps when you read this post you will install a newer version.

Continue reading…