archive #javascript
One cron pattern, five languages: Croner and OCPS
by Hexagon,
Croner started as a small cron library for JavaScript. It then got a Rust version, and recently Python and .NET versions. Now there is a fifth one, for C++. Five libraries that should answer the same question in the same way: when does 0 0 L * FRI run next? That turned out to be the easy part. The hard part was deciding what the right answer is.
rootcard: A new take on the password login, and an ID card for the web
by Hexagon,
So, there I was, with a game server where anyone could log in with just a name. The game is Xigna, a space MMO I'm building, and it needed real accounts. That should be easy. Hash the password, store the hash, add a reset by e-mail, done. But the more I looked at it, the less I liked it. A couple of weeks later I had built rootcard instead.
Cross-Runtime JavaScript: Streamlining Your Project Setup
by Hexagon,
Embrace the 'less-is-more' philosophy for cross-runtime JavaScript development. Discover how Deno's and Bun's built-in features reduces complexity and enhances your workflow.
Cross-Runtime JavaScript: Navigating Runtime Differences
by Hexagon,
Discover strategies for handling runtime differences and ensuring smooth cross-platform execution of your JavaScript code.
Cross-Runtime JavaScript: Introduction
by Hexagon,
Kickstart your cross-runtime JavaScript journey! Learn the basics and why building code for all runtimes (Node.js, Deno, and Bun) matters.
Introducing Lumocs: A Modern Documentation Engine based on Deno and Lume
by Hexagon,
Meet Lumocs, a documentation generator powered by JavaScript through Deno and Lume. This guide will walk you through the essential steps to set it up, create your first documentation page, and deploy your site.
If you want a quick showcase, check out the Lumocs Documentation, which is generated by Lumocs itself.
Autostarting And Monitoring Deno Applications And Services
by Hexagon,
Planning to host your Deno service or server on your own but unsure about how to launch it at system boot and ensure its uptime? This guide is here to help. Dive into Docker and Pup as robust options for managing Deno apps at system boot, guaranteeing their continuous operation, resilience, and monitoring.
Unshackling JavaScript: Vanilla JS Over Shims
by Hexagon,
Vanilla JavaScript, in its pure and authentic form, enables developers to utilize the language's native capabilities, freeing them from the confines and redundancies of libraries like jQuery and Lodash. This article reveals the elegance of such native alternatives and advocates for purity in coding practices.
Getting Started with Bun: A Blazing Fast Runtime for JavaScript
by Hexagon,
In the ever-evolving world of JavaScript runtimes, Bun is emerging as a promising star. It might not have the maturity of Deno or Node.js, but it compensates with promising great performance. Let's explore Bun in detail.
Event Loop and Concurrency Model in JavaScript
by Hexagon, , Updated:
In this article, we delve into the Event Loop and Concurrency Model in JavaScript, revealing how they enable non-blocking asynchronous behavior.
Design Patterns in JavaScript
by Hexagon, , Updated:
In this article, we'll explore common design patterns in JavaScript and how they can help you write clean, maintainable, and efficient code.
Getting Started with Deno: A Secure Runtime for JavaScript and TypeScript
by Hexagon, , Updated:
If you're into JavaScript or TypeScript, you've probably heard about Deno. It's an exciting new runtime that's often described as a more secure and simpler alternative to Node.js. In this blog post, we'll go over what makes Deno awesome and how to get started.
Show All Visitor's Pointers on a Webpage
by Hexagon,
In this step-by-step guide, you'll learn how to create a simple but cool webpage that shows mouse pointers of all its visitors. From setting up a Deno server to optional perks like keeping your app alive with Pup and serving it securely through Nginx.
Closures and Scopes in JavaScript
by Hexagon, , Updated:
In this article, we explore the important concepts of closures and scopes in JavaScript. Understand how scope works, what closures are, and how to use these features to write cleaner, more maintainable code.
Prototypes and Inheritance in JavaScript
by Hexagon, , Updated:
In this article, we'll delve into prototypes and inheritance in JavaScript, explaining how they provide a powerful way to create and manage objects. We'll also compare them with other forms of inheritance, particularly the class-based approach seen in languages like Java and C++.
Error Handling and Debugging in JavaScript
by Hexagon, , Updated:
In this article, we delve into the essential aspects of error handling and debugging in JavaScript. Learn about different types of errors, advanced debugging techniques, and various error-handling mechanisms to develop robust and maintainable JavaScript applications.
Working with Arrays in JavaScript
by Hexagon, , Updated:
In this section, we will explore arrays in JavaScript. You'll learn how to create arrays, access their elements, manipulate array data, and work with common array methods like push, pop, shift, and unshift. Understanding arrays is crucial as they are used extensively in JavaScript for storing and managing collections of data.
Building a Default Settings System Using the Spread Operator
by Hexagon, , Updated:
Today, we'll have a look at how the spread operator works by building a small system for managing default settings and overrides.
How to Create a Dual-Mode Cross-Runtime JavaScript Package
by Hexagon,
This article will guide you through publishing dual-mode, cross-runtime JavaScript packages. Learn to create libraries compatible with both ESM and CommonJS, as well as different runtimes like Node.js, Deno, and browsers.
Asynchronous code with JavaScript
by Hexagon, , Updated:
In this lesson, we will explore asynchronous code in JavaScript, learn what promises are, and how they relate to async/await.
Strings and Numbers in JavaScript
by Hexagon, , Updated:
In this post, we will explore two of the most common data types in JavaScript: strings and numbers. Strings are used to store text, while numbers are used to store numerical values. We will also learn how to manipulate strings and numbers using various methods and operators, how to avoid overflows using BigInts, and how to represent binary and hexadecimal numbers.
Introducing Minitz - Time zone conversion in JavaScript
by Hexagon,
Minitz is a minimal utility that allows you to convert to or from any timezone. It is compatible with Deno, Node, and browsers, and is less than 2KB when minified. The library is MIT-licensed, which means you can use it any way you want.
Working with Objects in JavaScript
by Hexagon, , Updated:
After mastering control structures and arrays, the next step is to understand another cornerstone of JavaScript: objects. Objects are essential for bundling related data and functions together, which makes your code more organized and manageable. This article covers the basics, object constructors, and modern syntax for working with objects. Prototypes and inheritance get their own article later in the series.
The Evolution of JavaScript and Why It Matters
by Hexagon, , Updated:
Understanding the past and how we got here can give us good hints about where we're going. Let's dig into JavaScript's history and how it's grown over time. Knowing this stuff will help us when we move on to more complicated topics like Promises, template literals, async/await, and the latest JavaScript features.
Using Lume: A Static Site Generator for Deno
by Hexagon,
If you're like me, you probably appreciate the simplicity of using a static site generator for your blog or website. Today, I want to share the beauty of Lume, a static site generator built for Deno.
Functions and type guards in JavaScript
by Hexagon, , Updated:
Now that we've covered control structures, let's step into another cornerstone of JavaScript: functions. Functions allow us to bundle code into reusable pieces. We will also cover type guards. Functions help reduce repetition and make our code neater.
Control Structures in JavaScript
by Hexagon, , Updated:
Control structures in JavaScript dictate how your code runs. They decide the flow of operations based on conditions and can repeat sections of code multiple times. Let's get a better understanding of these structures and their uses.
Fundamental Concepts of JavaScript
by Hexagon, , Updated:
In this section we'll cover the key elements that are essential to working with JavaScript. We'll touch on variables, debugging methods, and core principles. Let's dive in!
Scheduling Tasks in JavaScript or TypeScript with Croner
by Hexagon, , Updated:
Managing time-based tasks in JavaScript has never been easier with Croner, a powerful tool designed to trigger functions or evaluate cron expressions on various platforms. Whether you're working in Node.js, Deno, Bun, or even directly within a browser, Croner has you covered. In this article, I'll give you a brief introduction on how to use Croner.
The Guide to JavaScript - Introduction
by Hexagon, , Updated:
The aim of this series is to give a thorough understanding of vanilla JavaScript and its many features. We won't be using any external libraries, and all the code will be cross-runtime. It'll work seamlessly whether you're in a browser or using runtimes like Deno, Bun or Node.js.