Code with Hugo

Node.js and JavaScript Guides

  • Home
  • Books
  • Node
  • Testing
  • JavaScript
  • More...
  • Search
  • About
  • Gear & Setup
Subscribe
#meta #jamstack #hugo #javascript

Add Diagrams to your Jekyll/Hugo/Gatsby blog with Mermaid JS

Add diagrams to your JAMStack (Jekyll/Hugo/Gatsby) blog with Mermaid JS Update 17th January 2024: Hugo now has native hooks for diagrams, so that code-fences using ```mermaid [content]``` can have a custom template, see the Content Management > Diagrams > Mermaid diagrams ...

  • Hugo Di Francesco
    Author
4 min read
#javascript #node #meta

Yarn Workspaces: monorepo management without Lerna for applications and coding examples

How to use Yarn Workspaces to manage applications/coding examples. Lerna isn’t required when you don’t need the git diffing and versioning facilites. What’s more Yarn Workspaces are a great lightweight tool to get up and running faster for simple Node.js monore ...

  • Hugo Di Francesco
    Author
3 min read
#node #lunrjs #hugo #meta #javascript

Add Search to a Hugo site with Lunr.js and Node.js

Hugo “The world’s fastest framework for building websites” is a great option for JAMStack (JavaScript, APIs, prebuild Markup) sites. Lunr.js is “A bit like Solr, but much smaller and not as bright”, it’s a pure JavaScript implementation of a Solr-lik ...

  • Hugo Di Francesco
    Author
5 min read
#javascript

JavaScript Data Type Check Cheatsheet

JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. MDN Web Docs - javascript Detailed in this post are common JavaScript data type checks, pitfalls and idiomatic workarounds. ...

  • Hugo Di Francesco
    Author
11 min read
#jamstack #css #tailwind #deployment

Tailwind CSS 1.x impressions, development and production setup for static sites with Tailwind CLI and PurgeCSS CLI

How to set Tailwind CSS up with a static site hosted on Netlify See the full starter repository at github.com/HugoDF/netlify-lambda-tailwind-static-starter Tailwind CSS is “a utility-first CSS framework for rapidly building custom designs”. I’ll be walking through my first ...

  • Hugo Di Francesco
    Author
6 min read
#javascript #jest #testing #node

Jest ignore or exclude file/function/statement from test coverage

In computer science, test coverage is a measure used to describe the degree to which the source code of a program is executed when a particular test suite runs. Code coverage - Wikipedia Code coverage is usually used as a quality metric for software eg. “Our code has to have 80% ...

  • Hugo Di Francesco
    Author
4 min read
#node #serverless #javascript #automation #deployment

Super-powered newsletter content with Pocket and Netlify Lambda

An example Netlify Lambda to fetch all “newsletter” posts from Pocket. Pocket is an application and web service for managing a reading list of articles from the Internet. It’s quite widely used and tightly integrated into the Firefox browser. I find that I use it extensive ...

  • Hugo Di Francesco
    Author
5 min read
#javascript #node #jest #testing #MongoDB

Avoiding recursion pitfalls: MongoDB nested query clause addition and removal

A case-study on where recursion can be useful for enterprise Node.js applications and how to avoid its common pitfalls like RangeError: Maximum call stack size exceeded. The full repository for this post is on GitHub: github.com/HugoDF/mongo-query-clause-modification We’ll ...

  • Hugo Di Francesco
    Author
7 min read
#node #Express #javascript

Read and parse POST/PATCH/PUT request JSON or form body with Express and no dependencies

When asked to handle data in a request body, developers who have used Express (the “Fast, unopinionated, minimalist web framework for Node.js”) before, reach for the body-parser library. What they might not know is that body-parser is a dependency of Express and its main JSON par ...

  • Hugo Di Francesco
    Author
5 min read
#node #javascript #Sequelize #productivity

Using ES6 classes for Sequelize 4 or 5 models

The ES2015 or ES6 specification introduced class to JavaScript. Libraries like React went from React.createClass to class MyComponent extends React.Component, ie went from rolling their own constructor to leveraging a language built-in to convey the programmer’s intent. For a Nod ...

  • Hugo Di Francesco
    Author
3 min read
← Next Posts Page 8 of 15  Previous Posts →

Interested in Alpine.js?

Power up your debugging with the Alpine.js Devtools Extension for Chrome and Firefox. Trusted by over 15,000 developers (rated 4.5 ⭐️).

Install Now close
Code with Hugo
Latest Posts Github