#js
21 posts tagged js. All posts
Keeping an element above the fold in React with refs and getBoundingClientRectMeasure where an element ends up on the page with a React ref and getBoundingClientRect, then shift it up with a negative top offset so it stays above the fold.
Getting started with react-spring: useSpring and useTrail examplesThree small react-spring examples (a fade-in, a slide and a staggered trail) using the current @react-spring/web package and the .to() API.
Storing PEM keys in cloud environment variables with base64Why multi-line values like PEM keys break in environment variables, and how to base64-encode them in bash and decode them in JavaScript.
Clustering map markers in React Native with superclusterBuild a clustered MapView for react-native-maps with supercluster: group nearby markers, show a count bubble, and zoom in when a cluster is tapped.
Add a Google Map with a marker to a web page using the Maps JavaScript APIGet an API key, load the Google Maps JavaScript API, and render a map with an advanced marker in a plain HTML page.
Networked Phaser game, part II: the browser clientThe Phaser 2 browser client for a multiplayer pirate ship game: input, Socket.IO sync with the Node server, interpolation, collisions and health.
Multiplayer Phaser game, part I: the Node.js and Socket.IO serverHow the server for my Phaser pirate-ship game tracks players, bullets, health packs and driftwood, and broadcasts state with Express and Socket.IO.
Downloading League of Legends match history with Deno and the Riot APIA Deno script that pages through a player's League of Legends match IDs with Riot's match-v5 API, plus why custom games don't show up.
Fetching Pokémon data from PokeAPI in Rust with reqwest and serdeBuild a small Rust CLI that looks up a Pokémon on PokeAPI, deserializes the JSON with serde, and prints its height, weight, and types.
A React image component with a loading skeleton and fallback imageBuild a React image component that shows a shimmer skeleton while the image loads and swaps to a fallback image if it fails, without error loops.
Node.js 18: built-in fetch and the node:test runnerTwo Node.js 18 additions that replace npm packages: a global fetch() enabled by default, and the built-in node:test test runner.
Building a command-line app in TypeScript with Commander.jsSet up a TypeScript project, define commands, arguments and options with Commander.js, compile with tsc, and install the result as a runnable CLI.
Why JavaScript's Date is painful, and what to use insteadWhere the built-in Date object trips you up with time zones and parsing, and how Intl, Temporal, Moment Timezone and date-fns-tz handle the same conversions.
SVG wave hero section for an investing homepage with Vue and VuesaxGenerating SVG wave paths in a Vue component, and building an animated wave hero section for an investing blog homepage with Nuxt 2 and Vuesax.
Building a scripted chat bot in React with react-simple-chatbotA small scripted "about me" chat bot built with react-simple-chatbot, where each step shows a message or a set of options that decide the next step.
React Navigation basics: stacks, params, tabs, deep links and transitionsSet up React Navigation 7 in a React Native app, pass params between screens, nest a stack in tabs, handle deep links and change screen transitions.
Build a to-do list with Next.js API routes and Neon PostgresA Next.js to-do app with an MUI frontend, SWR data fetching, Pages Router API routes, and a Neon Postgres database accessed through node-postgres.
Async JavaScript: promises, async/await and fetchHow promises and async/await work in JavaScript, plus making HTTP requests with fetch, handling errors, cancelling with AbortController and caching responses.
Running an Express server in a Docker containerWrite a Dockerfile for a small Express app, build the image, and run it with the port mapped to your machine.
Install Node.js and run your first Express serverInstall Node.js on Windows, macOS or Linux, then build a minimal Express 5 server with a start script and static file hosting.
Introduction to JavaScript: a free ebook on JS, Node.js and promisesAn introductory ebook on JavaScript, Node.js and asynchronous programming, written in LaTeX and published on Amazon KDP, with a free PDF copy.
© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)