JavaScript
27 articles
Abstract Syntax Trees
An Abstract Syntax Tree (AST) is a tree-like data structure that represents the syntax of source code in a structured, abstract way. ASTs are created during parsing and are essential for compilers, interpreters, and code analysis tools.
Apify SDK
Apify SDK is an open-source web scraping and automation platform built on Node.js that enables you to build custom scrapers, automate browsers, manage proxies, and deploy crawlers to the cloud with built-in data storage.
AST Visualization with D3.js
A React component that visualizes Abstract Syntax Trees as interactive D3.js tree diagrams. The component uses d3.tree() for layout, circle nodes, path links, and React hooks to update when the AST data changes.
Automating Google Lighthouse
Learn how to automate and parallelize Google Lighthouse audits across multiple URLs with controlled concurrency limits using the p-limit library.
Convert Promises to Async Await
Converting Promise chains to async/await makes asynchronous JavaScript more readable and maintainable. This guide shows practical examples of refactoring Promise-based code using the async/await syntax.
D3.js (Data Driven Documents)
D3.js (Data-Driven Documents) is a popular open-source JavaScript library developed by Mike Bostock for creating dynamic, interactive data visualizations. It offers powerful data manipulation and binding capabilities, though as a low-level library it requires more code than higher-level alternatives.
Extracting Metadata from Audio Files
Learn how to extract metadata like artist and album information from audio files using jsmediatags, a JavaScript library that supports MP3, FLAC, AAC, M4A, OGG, WAV, and MP4 formats.
Extracting Text from epub Files
Learn how to use the epub and turndown modules in Node.js to extract text from EPUB documents and convert it to markdown format, with code examples for extracting full books or individual chapters.
Flatten An Array
A recursive approach to flattening deeply nested arrays in JavaScript using the reduce() method and concat() to build a single-level array from multiple levels of nesting.
HTTP Delete Method from Browser and curl
Two practical approaches to making HTTP DELETE requests: using the fetch() function in your browser's JavaScript console, or curl commands from the terminal with optional credentials.
Implementing Hashes
A guide to building hash tables in JavaScript, covering simple hash functions, chaining for collision resolution, and open addressing techniques like linear probing.
InfluxDB and MongoDB from GraphQL
Learn how to build a GraphQL server that queries both MongoDB and InfluxDB simultaneously, with a complete TypeScript example using Apollo Server.
InfluxDB from GraphQL
Query InfluxDB with GraphQL syntax using the influx-graphql npm library. This guide shows how to create a GraphQL schema for InfluxDB and execute queries using ES6 JavaScript.
JSON Server
JSON Server lets you spin up a mock REST API in seconds with a JSON file. Learn how to install it, create your data file, and start serving at localhost:3000.
LinkedList
A complete singly linked list implementation in JavaScript, featuring insertion and removal at both ends, indexed access, and utility methods for tracking size and checking if the list is empty.
Load Blender Models with Three.js
A practical guide to exporting Blender models and rendering them on the web using Three.js. Includes complete JavaScript code examples for loading OBJ files with WebGL.
Map Reduce
Explore how to use .map() and .reduce() in JavaScript to transform data, create objects, sum values, and group arrays. Includes hands-on code examples.
Merge JSON Trees Recursively
A step-by-step guide to merging JSON trees recursively using ES6. This example function demonstrates how to combine nested objects while prioritizing values from the second tree when keys overlap.
More Examples for Reduce
Learn five practical ways to use JavaScript's reduce() method, from finding maximum values and flattening arrays to counting occurrences, removing duplicates, and grouping objects by properties.
Programmatic SVGs
Explore NPM packages for creating SVGs in JavaScript, including SVG.js, D3.js, Snap.svg, and Rough.js. Learn how to animate SVG elements using the Web Animations API with practical code examples.
Quirk - JSON.stringify removes empty properties
When upserting documents in MongoDB, undefined properties don't reset fields. Learn how to use a custom replacer function with JSON.stringify to convert undefined to null.
react-markdown
Learn how to install and configure react-markdown with remark-gfm and react-frontmatter plugins to render markdown in your React app.
Resolving Multiple Promises
Discover how to resolve multiple promises concurrently using Promise.all() in ES6, with practical examples and error handling strategies.
Setup an ES6 NodeJS Project
A step-by-step guide to initializing an ES6 Node.js project using npm, including configuration of Babel for ES6-to-ES5 transpilation and nodemon for automatic server restarts during development.
Snap.svg
Snap.svg is a JavaScript library created by Dmitry Baranovskiy that makes it easy to work with SVG graphics, animations, and interactive elements on the web.
SVG.js
SVG.js is a lightweight JavaScript library that simplifies working with SVG elements in web pages. It offers powerful features like animations, transformations, path manipulation, and an extensible plugin system.
UnifiedJS
Unified is a powerful JavaScript framework for building compilers, linters, and code analysis tools by working with abstract syntax trees (ASTs) using a unified, modular plugin architecture that supports multiple content formats like Markdown and HTML.