Code with Hugo: Production JavaScript & Node.js Guides

Archive

Code with Hugo #93 - Mar 2nd 2021

Welcome to the 93th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#93
March 2, 2021
Read more

Cypress Scroll Assertions - Code with Hugo - Feb 9th 2021

Welcome to the 92nd Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#92
February 9, 2021
Read more

What the "?." is Optional Chaining? - Code with Hugo - Nov 10th 2020

Welcome to the 91st Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#91
November 10, 2020
Read more

Magic Data URLs - Code with Hugo - Oct 27th 2020

Welcome to the 90th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#90
October 27, 2020
Read more

Disable an Anchor Tag - Code with Hugo - Aug 18th 2020

Welcome to the 89th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#89
August 18, 2020
Read more

Alpine.js Accessible Menu - Code with Hugo - Aug 11th 2020

Welcome to the 88th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#88
August 11, 2020
Read more

Alpine.js in-depth "x-on" - Code with Hugo - Aug 4th 2020

Welcome to the 87th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#87
August 4, 2020
Read more

Alpine.js Reactive HTML attribute binding - Code with Hugo - Jul 28th 2020

Welcome to the 86th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#86
July 28, 2020
Read more

Alpine.js in-depth: Show/Hide with x-show - Code with Hugo - Jul 21st 2020

Welcome to the 85th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#85
July 21, 2020
Read more

GitHub Review Trick - Code with Hugo - Jul 14th 2020

Welcome to the 84th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#84
July 14, 2020
Read more

Alpine.js Fundamentals Part 1 - Code with Hugo - Jul 7th 2020

Welcome to the 83rd Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#83
July 7, 2020
Read more

Alpine.js Iterate n times with x-for - Code with Hugo - Jun 30th 2020

Welcome to the 82nd Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#82
June 30, 2020
Read more

Iterate Through JavaScript Objects in Alpine.js - Code with Hugo - Jun 23rd 2020

Welcome to the 81st Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#81
June 23, 2020
Read more

Use JavaScript like TypeScript with JSDoc & VSCode - Code with Hugo - Jun 16th 2020

Welcome to the 80th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#80
June 16, 2020
Read more

Sync Alpine.js state to localStorage - Code with Hugo - Jun 9th 2020

Welcome to the 79th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#79
June 9, 2020
Read more

Accessing Alpine.js Magic Properties - Code with Hugo - Jun 2nd 2020

Welcome to the 78th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#78
June 2, 2020
Read more

Inspect Alpine.js Component Data - Code with Hugo - May 26th 2020

Welcome to the 77th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#77
May 26, 2020
Read more

Alpine.js Component Communication Patterns - Code with Hugo - May 19th 2020

Welcome to the 76th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#76
May 19, 2020
Read more

Alpine.js + Javascript/jQuery Plugin Integration Guide - Code with Hugo - May 12th 2020

Welcome to the 75th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#75
May 12, 2020
Read more

Pass/Fail AVA Tests Based on Environment Variables - Code with Hugo - May 6th 2020

Welcome to the 74th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.

Here are 3 links I think are worth your time this week,

#74
May 6, 2020
Read more

URL Syncing Fundamentals in JavaScript with Alpine.js - Code with Hugo - Apr 28th 2020

Welcome to the 73rd Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#73
April 28, 2020
Read more

Alpine.js + Pre/Server-Rendered Content - Code with Hugo - Apr 21th 2020

Welcome to the 72nd Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#72
April 21, 2020
Read more

A New Prototyping Stack - Code with Hugo - Apr 14th 2020

Welcome to the 71st Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

I’ve had great success prototyping with Excalidraw for mockups, + for visuals and to input, inject and organise data in a readable format.

#71
April 14, 2020
Read more

Finding a Simple Static Site Generator - Code with Hugo - Apr 8th 2020

Welcome to the 70th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#70
April 8, 2020
Read more

3 Books That Are Worth Your Time - Code with Hugo - Mar 17th 2020

Welcome to the 69th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 books I think are worth your time in the next couple of week,

#69
March 17, 2020
Read more

Practical Alpine.js: the Basics - Code with Hugo - Mar 10th 2020

Welcome to the 68th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#68
March 10, 2020
Read more

Replacing jQuery Soup with this tiny library - Code with Hugo - Mar 3rd 2020

Welcome to the 67th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#67
March 3, 2020
Read more

Finding Happiness as a Software Engineer - Code with Hugo - Feb 6th 2020

Welcome to the 66th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week, they’re around the theme of how to do more of what makes you happy as a software engineer (be that money, more free time, travelling or using tools you enjoy).

#66
February 6, 2020
Read more

Manage Videos with HTML5 & JavaScript - Code with Hugo - Jan 28th 2020

Welcome to the 65th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enteprise patterns.

Here are 3 links I think are worth your time this week,

#65
January 28, 2020
Read more

Fix App Permission Issues on Mac - Code with Hugo - Jan 21st 2020

Here are 3 links I think are worth your time this week,

  1. Catalina “Apple cannot check for malicious software” Command Line Fix (2 min read):

#64
January 21, 2020
Read more

Welcome to 2020 - Code with Hugo - Jan 15th 2020

Welcome to 2020 on Code with Hugo,

Here are 3 links I think are worth your time this week,

#63
January 15, 2020
Read more

Revamped Newsletter Courtesy of freeCodeCamp - Code with Hugo - Dec 3rd 2019

Last week I had a call with Quincy Larson of freeCodeCamp (to be onboarded as an author).

I’m a massive fan of the work he’s done with limited resources, we got to chatting and realised that we’re both trying to solve the “content is out there but not in the right format” problem.

He showed me his newsletter template, and I’ve shamelessly decided to copy it. It goes as follows:

Here are 3 links I think are worth your time this week,

#62
December 3, 2019
Read more

The Jest Handbook available for Preorder - Code with Hugo - Nov 26th 2019

The Jest Handbook is now ready for preorders.

If you’re curious about advanced Jest features, or want to level up your JavaScript testing fundamentals (or just want to support Code with Hugo), this is for you: .

#61
November 26, 2019
Read more

Jest Mock Set, Reset and Clear - Code with Hugo - Nov 12th 2019

Hot off the press

Jest set, clear and reset mock/spy/stub implementation: Between test runs we need mocked/spied on imports and functions to be reset so that assertions don’t fail due to stale calls (from a previous test).

If you missed it

#60
November 12, 2019
Read more

Jest .spyOn/jest.fn() Stub Assertion Reference - Code with Hugo - Nov 5th 2019

Hot off the press

Jest .fn() and .spyOn() spy/stub/mock assertion reference: Where other JavaScript testing libraries would lean on a specific stub/spy library like Sinon - Standalone test spies, stubs and mocks for JavaScript.

If you missed it

#59
November 5, 2019
Read more

Jest Partial Array Object Match - Code with Hugo - Oct 29th 2019

Hot off the press

Jest Array/Object partial match with objectContaining and arrayContaining: It’s possible to do partial matches on Arrays and Objects in Jest using expect.objectContaining and expect.arrayContaining.

I’ve got some free ebook review referral copies of Professional JavaScript still available, if you’re interested and you’re eligible (have spent $50 on Amazon in the past calendar year so you can leave a review), let me know by replying (hi@codewithhugo.com).

#58
October 29, 2019
Read more

Jest Force Fail - Code with Hugo - Oct 22nd 2019

👋 Welcome to this week’s newsletter where we discuss how to programmatically fail a test, why you would want to do so and more.

Hot off the press

Jest explicitly or arbitrarily force fail() a test: When testing code with Jest, it can sometimes be useful to fail a test arbitrarily.

#57
October 22, 2019
Read more

Jest requireActual - Code with Hugo - Oct 15th 2019

Hot off the press

I’ve added a new section “Partial module mocking with jest.requireActual“ to .

#56
October 15, 2019
Read more

Advanced Jest Kickoff - Code with Hugo - Oct 8th 2019

I’m working on an Advanced Jest Guide to save everyone time when faced with non-trivial Jest issues.

Jest is super powerful and has really nifty features that are underused which give you superpowers.

This is in addition to the book I’ve been co-authoring, “Professional JavaScript” being published with Packt. I’ve learnt a lot from that experience and hopefully I can put those new skills to good use in this project.

#55
October 8, 2019
Read more

JAMstack Scheduled Posts and Vue.js Click Modifiers - Code with Hugo - Oct 1st 2019

Hot off the press

Auto-publish future posts with JAMstack on Netlify and IFTTT/CircleCI 2.0 scheduled jobs: Static site generators like Hugo, Jekyll, Hexo, Gatsby or other JAMstack alternative are a great option to run your blog on.

I love micro, but Express is just too ubiquitous at the moment.

#54
October 1, 2019
Read more

Performance + Update - Code with Hugo - Sep 24th 2019

Hot off the press

Performance improvements 👀

#53
September 24, 2019
Read more

Command/Control + Click in Vanilla JavaScript and React - Code with Hugo - Sep 17th 2019

Hot off the press

Detect ctrl/CMD/alt/shift + Click in Vanilla JavaScript and React: Detecting control-click, command-click, alt-click and shift-click in JavaScript without listening to keydown events is straightforward.

In fun fails, I configured a healthcheck for an app to fetch the RSS feed of Code with Hugo every minute… leading to a bunch of uncached traffic.

#52
September 17, 2019
Read more

Node.js Micro Analytic Events Server - Code with Hugo - Sept 10th 2019

Hot off the press

Record analytics events with a Zeit “micro” + SQLite3 Node.js application: In order to finally switch off Google Analytics, I need to replace my goal conversion tracking somehow.

In Code with Hugo performance improvements this week. I got rid of Google Analytics. It’s just and my custom event recording service backed by SQLite.

#51
September 10, 2019
Read more

Jest Sequential Tests - Code with Hugo - Sep 3rd 2019

Hot off the press

How to run Jest tests sequentially: By default Jest runs tests in parallel with a “a worker pool of child processes that run tests” (Jest CLI docs).

Recent work to leverage ‘s asset pipeline for both resource bundling and image resizing has been successful. The outcomes are documented in the following thread, should now be snappier and less data-hungry (no 1500x1500 images used as thumbnails any more):

#50
September 3, 2019
Read more

Node.js detect require-ed or directly invoked module - Code with Hugo - Aug 27th 2019

Hot off the press

Detect if the current file/module is the entrypoint or import/require-d in Node.js: How does one identify whether a JavaScript file is being run directly (node file.js) or it’s being import/require-d (require(‘./file’) in another JS file).

Updated the on my page.

#49
August 27, 2019
Read more

ES6 Array Unique/Dedupe with Sets - Code with Hugo - Aug 20th 2019

Hot off the press

JavaScript ES6 Array remove duplicates/get unique values in-depth with Set and spread/iterables: With ES6, more developers should be leveraging built-ins than are using lodash functions. Here is an ES6 implementation of lodash/underscore’s uniq: const dedupe = list => […new Set(list)]; This post goes through the how and why this works.

If you missed it

#48
August 20, 2019
Read more

Add Diagrams to your blog posts with Mermaid JS - Code with Hugo - August 13th 2019

Hot off the press

Add Diagrams to your Jekyll/Hugo/Gatsby blog with Mermaid JS: The following post will go through how to integrate Mermaid JS, a “simple markdown-like language for generating charts”.

You should also have a look at the .

#47
August 13, 2019
Read more

Monorepos with Yarn Workspaces - Code with Hugo - Aug 6th 2019

Hot off the press

Yarn Workspaces: monorepo management without Lerna for applications and coding examples: How to use Yarn Workspaces to manage applications/coding examples.

Started work on a widget: “SponsorCost” available on . I’m scratching my own itch, I keep having to Google for reasonable prices for sponsorship, so that’s that.

#46
August 6, 2019
Read more

Mocking Full and Partial Imports with Jest - Code with Hugo - Jul 30th 2019

Hot off the press

Jest Full and Partial Mock/Spy of CommonJS and ES6 Module Imports: The example repository is available at github.com/HugoDF/mock-spy-module-import.

New repos:

#45
July 30, 2019
Read more

Jest .toHaveBeenCalled Assertions - Code with Hugo - Jul 23rd 2019

Hot off the press

Jest assert over single or specific argument/parameters with .toHaveBeenCalledWith and expect.anything(): With Jest it’s possible to assert of single or specific arguments/parameters of a mock function call with .toHaveBeenCalled/.toBeCalled and expect.anything().

I’ve been toying with a new project, there’s prior art in the field (but was discontinued).

#44
July 23, 2019
Read more
 
Older archives
Brought to you by Buttondown, the easiest way to start and grow your newsletter.