thisdaveJ

Beginner’s Guide to Installing Node.js on a Raspberry Pi

This article has been updated to cover the installation of both Rasperry Pi OS Bullseye and the latest version of Node at the time of this writing which is Node .x. In this installment of my LTM (Learning through Making) series of Node.js tutorials, I will show you how to get Node.js up and running on a Raspberry Pi 4 (or Pi 3, or Pi 2).  I’m focusing on the Raspberry Pi 4/ Pi 3 / Pi 2 rather than older versions such as the Raspberry Pi Model B+ since these are the latest models at the time of this writing.  The Raspberry Pi 4, for example, sports a 1.5 Read More

Share
Node emoji

Add Emoji to your Node Projects with node-emoji ✨

Attention 📣 Node developers. We’re building highly functional applications, but it’s time to add some pizzazz and breathe new life into our software creations. In this article, we’ll learn how to sprinkle in some emoji to add sparkle✨ to our Node projects with the help of the node-emoji package. We’ll culminate our efforts with the creation of a command-line emoji picker that we can use in a variety of contexts.

Share
Raspberry Pi ngrok

How to Host a Raspberry Pi Web Server on the Internet with ngrok

In Create a Web Server in Node without any Code, we used the http-server npm module to create a web server and serve up files in record time. Today I will share a way you can take the web server you built and make it available beyond your local network and on the public Internet. This is cool trick, but I recommend that you use this with caution as this will open a hole in your router/firewall when you make your web server available to the world. Let’s get started!

Share
Winston

Using Winston, a versatile logging library for Node.js

Today, we will explore Winston, a versatile logging library for Node.js. Winston can be used in numerous contexts including in Node web frameworks such as Express, and Node CLI apps. We will also dive into features that make Winston a good fit for IoT applications such as logging timestamped entries to files. This article has been updated to reflect the latest generation of Winston at the time of this writing which is Winston 3.x.

Share
Node file watching

How to Watch for Files Changes in Node.js

In a previous article on counting unique items in a JavaScript array, I introduced you to the system I am creating that enables our family to log when the fish 🐟 in our aquarium have been fed. The feeding times are logged to a file by pressing a push-button on a circuit board connected to a Raspberry Pi, pressing an Amazon Dash button, or clicking a button through a web interface. The resulting log file looks like this: 2018-5-21 19:06:48|circuit board 2018-5-21 10:11:22|dash button 2018-5-20 11:46:54|web Our next challenge is to watch this log file for changes as button pushes are streamed in from one of our three sources (Amazon Read More

Share
Node.js Handlebars

Learn Handlebars with Node.js and Help Freddy’s Fish Too

Our friend Freddy Fishman needs our help. He recently launched an aquaponics business to raise fish 🐟 and cultivate underwater plants, and he needs a real-time report to ensure the environmental conditions of his fish tanks are optimized so both his fish and plants can thrive. Another friend of his wired up some Arduino-based fish tank sensors and created a data stream that flows to a local JSON file; therefore, the data foundation is already in place. Can we help Freddy and his fish farm? I think we’re up for the task! We’ll help Freddy and we’ll help ourselves as we learn how to use Handlebars, a templating library that Read More

Share
Upgrade Node.js Windows

Install and Upgrade Node.js on Windows the Easy Way

It’s easy to install and upgrade Node.js on the Raspberry Pi as explained in my guides on installing Node.js and upgrading Node.js on a Raspberry Pi. In fact, it’s easy on any Linux-based system. For Windows systems, however, the default installation routine of downloading and running MSI files from the Node.js website is not so streamlined. I was not keeping Node.js on my Windows systems up to date due to the activation energy required to do the installations. Today, however, everything changes. In this article, we will learn how to install and upgrade Node.js on Windows from the command line—and make the ongoing upgrade process as easy as double clicking Read More

Share
toml files

Using TOML Config Files in Your Node.js Applications

In this article, we’ll learn how to use TOML, a rising star ⭐in the configuration file world, with Node.js. After reading this article, you will understand the TOML syntax including how to use it to model JavaScript objects in your Node applications. After recently finishing my tutorial on Using INI Files with Node.js, I stumbled across the TOML configuration file format when conducting some focused learning on Rust. It turns out that Cargo, Rust’s package manager, uses TOML for its Cargo.toml configuration file, which serves in a similar capacity to the package.json file used by npm with Node. I excitedly delved into TOML and to learn more, and emerged quite Read More

Share
Raspbian Lite

Create a Lightweight Raspberry Pi System with Raspbian Lite

In this tutorial, we’re going to build a highly optimized Raspberry Pi system that runs very lean on resources with the help of Raspbian Lite.  Whereas a baseline Raspbian system consumes around 158 MB of RAM, Raspbian Lite runs at a mere 34 MB.  To achieve this lighter weight footprint, we must give up the graphical user interface (GUI); however, we’ll include steps in the build (and tips) to help us work productively without a GUI. This guide follows the same flow as my popular Beginner’s Guide to Installing Node.js on a Raspberry Pi, and I recommend that you use that guide if you are a beginner or if you simply Read More

Share