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
curl-jq

Consuming Web API JSON Data Using curl and jq

Hey everyone! I decided to put a few extra batteries in the background color of the article image above. 🙂 I’m actually pretty charged up about our topic today, particularly about jq, which is a lightweight and flexible command-line JSON processor with “batteries included”.

Share
thisdaveJ

Web Scraping with Google Sheets: The Definitive Guide

In this tutorial, we learn how to scrape data from web pages and display the results in Google Sheets. We start with the standard built-in Sheets functions and move on to more advanced methods using custom JavaScript functions.

What is web scraping, you say? Web scraping is a technique of automatically extracting unstructured data from web pages using a computer rather than manually copying and pasting data. It is necessary when the data to extract is not available in a well-defined format such as JSON or XML.

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
Count array items in JavaScript

How to Count Unique Items in JavaScript Arrays

The fish 🐟 in our home aquarium aren’t very communicative. I don’t necessarily need them to communicate their deepest emotions, but it would be helpful if they would at least tell me when they are hungry. Believe it or not, they don’t. Alas, when I peer inside the aquarium, I don’t know if they are hungry or if someone else in the family has already fed them breakfast🍩 or dinner🍕. IoT to the rescue! I am in the process of creating a system that enables our family to log when the fish have been fed. The feeding times can be logged by pressing a push-button on a circuit board connected 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
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