Web Tools #488 - copyWithin(), JS Utilities, Databases, Uncats

Web Tools Weekly
WEB VERSION
Tools for Web Developers

Issue #488 • November 24, 2022

Advertisement
Hey Devs, Meet TelemetryHub!
TelemetryHub is an observability tool that collects all your complex telemetry data into a single pane of glass view by leveraging the power of OpenTelemetry. Get optimal transparency into your distributed system without per-seat pricing!

Get a Quick Demo!
Telemetry Hub

A lesser-known but useful little array method you might want to take note of is the Array.copyWithin() method, which has excellent browser support. This method allows you to copy a portion of an array to another part of the same array.

The method takes up to three arguments:

  • target - An integer representing the index in the array where you want the copied portion to end up. A negative value starts counting from the end of the array. Defaults to zero if omitted.
  • start – Optional integer representing the index in the array where you want to start copying within the array. Default is zero.
  • end – Optional integer representing the index where the copied portion will end (but not including the "end" index). 
Here are some examples:
 
// [1,2,3,1,2,3]
console.log([1, 2, 3, 4, 5, 6].copyWithin(3));

// [1,2,3,1,2,6]
console.log([1, 2, 3, 4, 5, 6].copyWithin(3, 0, 2));

// [1,5,6,4,5,6]
console.log([1, 2, 3, 4, 5, 6].copyWithin(1, 4));

// No change, target is higher than array's last index
console.log([1, 2, 3, 4, 5, 6].copyWithin(6, 0, 2));

// [1,,undefined,4,,undefined]
console.log([1, , undefined, 4, 5, 6].copyWithin(4, 1));

Try it on CodePen

As you can see, I'm using the method directly on each array. I wouldn't normally do this, but for demo purposes it's helpful because the copyWithin() method mutates the original array.

Some other things to keep in mind when using this method:

  • If you're familiar with C and C++'s memmove function, this works similarly.
  • Notice in the last example above, I'm copying a portion of an array that has an empty slot and a value of undefined. This is to demonstrate that copyWithin() preserves these during its operation.
  • copyWithin() doesn't affect the length of the array, even if the portion being copied is theoretically adding to the end of the array.
Probably the only annoying part of using this method is the fact that it won't copy up to the end value (the optional third argument). A few JavaScript methods have that same behaviour, so it's something to take note of.
 

Now on to this week's tools!
 

JavaScript Utilities

Hey Devs, Meet TelemetryHub!
TelemetryHub is an observability tool that collects all your complex telemetry data into a single pane of glass view by leveraging the power of OpenTelemetry. Get optimal transparency into your distributed system without per-seat pricing!     SPONSORED  

IP Index
A fast offline IP lookup library that's a self-sufficient web service providing info about an IP, particularly its ASN, country of origin, and whether it's hosting or not.

fast-querystring
A fast query string parser and stringifier to replace the legacy node:querystring module.

xoid
A framework-agnostic state management library with a Recoil-inspired AP, designed for simplicity and scalability.

Viselect
A dependency-free, high-performance, and lightweight library to add a visual way to select elements, similar to selecting on your Desktop, with integrations for most major JS frameworks.

TanStack Router
A type-safe router with built-in caching and URL state management for JS/TS, React, Preact, Solid, Vue, Svelte, and Angular.

TanStack Router

neodrag
A set of lightweight multi-framework libraries for draggability on the web.

Syntax
A component for Framer that uses Highlight.js and allows you to add code snippets to your pages.

Multiple-Uploader.js
A pure JavaScript library that lets you add a multi-image file uploader to a page, with real-time previews.

Favicons
A Node.js module for generating favicons and their associated files, originally built for the old Web Starter Kit boilerplate by Google.

Slash
A collection of 30+ TypeScript/JavaScript packages that can serve as a foundation to provide high quality web services.

wrand
A utility to extract one or more random elements from a weighted array.

 

JSON Tools, Databases, etc.

Black Friday Sale: React for Beginners
Wes Bos is having his annual half-price sale for all his web development courses, including Advanced React, Beginner JavaScript, and ES6 for Everyone.   SPONSORED  

Steampipe
An open-source CLI to use SQL to instantly query your cloud services (AWS, Azure, GCP and more), no database required.

Flyweight
An ORM for SQLite and Node that combines a simple API for performing basic operations, with the ability to create SQL queries that are typed and automatically mapped to complex object types.

Translate i18next
An online tool that uses the Google Translate API to translate JSON data to a chosen language, for use in i18next, the internationalization framework.

js2xmlparser
A Node.js module for parsing JavaScript objects into XML, designed primarily for JSON-type objects, arrays, and primitive data types.

SafeQL
An ESLint plugin for writing SQL queries in a type-safe way, compatible with popular SQL libraries.

Kanel
Generate TypeScript types from a live Postgres database, for people who don't like ORMs but who like Intellisense and type checking for their database access code.

Xata
A serverless database with built-in powerful search and analytics, one API, multiple type-safe client libraries, optimized for your development workflow, and has a decent free plan.

rqlite
An easy-to-use, lightweight, distributed relational database that uses SQLite as its storage engine.

JSON Crack
An online JSON editor to seamlessly visualize your JSON data instantly into graphs. Also available as a VS Code extension and native app.

JSON Crack

dblab
A fast and lightweight interactive terminal based UI client for PostgreSQL, MySQL, and SQLite3, written in Go and works on OSX, Linux, and Windows.

dangoDB
A lightweight MongoDB Object Document Mapper (ODM) built for Deno that provides the core functionality and familiar look and feel of established Node-based libraries for the Deno runtime.

 

The Uncategorizables

Black Friday Sale: Advanced React
Wes Bos is having his annual half-price sale for all his web development courses, including React for Beginners, Beginner JavaScript, and ES6 for Everyone.   SPONSORED  

Katana
A Go-based next-generation, fast, configurable, crawling, and spidering framework.

Answer
An open-source knowledge-based community software you can use to quickly build a Q&A community for product technical support, customer support, user communication, and more.

Mona & Hubot Sans
A pair of beautiful variable fonts from the team at GitHub.

Random User Generator
An open-source API for generating random user data in JSON, CSV, YAML, or XML formats.

Figma Autoname
A Figma plugin that uses AI to name your Figma layers automatically.

Laudspeaker
An open source, cross-channel customer messaging platform that you can self host.

Laudspeaker

macapps.link
An online tool that generates a terminal command for Mac users who want to quickly choose and install all their apps on a new device.

Ninite
The Windows equivalent of the previous tool. Choose what apps you want to install for a new device, and this tool will generate a custom installer you can run.

Whoiser
A WHOIS client for Node.js that helps with querying WHOIS servers for TLDs, domain names, AS numbers, and IPs.

Happy DOM
A JavaScript implementation of a web browser without its graphical user interface that includes many web standards from WHATWG DOM and HTML.
 

Commercial Apps and Classifieds

These are commercial apps, affiliate links, PPC ads, and paid classifieds. Submit yours!
PopSQL – A collaborative SQL editor to write queries, visualize data, and share your results.
Aptakube – A lightweight desktop client for Kubernetes, to manage workloads on multiple clusters.
Babbel – A language learning platform trusted by over 10 million subscribers worldwide.    AD
The Juice – Get access to aggregated career-enhancing resources from top brands.    AD
SnapShooter – Scheduled snapshots for servers, databases, and applications on all providers.
CommandBar – A widget to give users actions, support content, powerful search, and more.
AskEdith – A natural language
interface for databases to translate English to SQL.

A Tweet for Thought

I really like this comparison of a bad error message vs. a good error message. If I'd seen the bad one alone, I don't think I would have picked out the problems. The actual source is from Jenni Nadler (the Tweet author mentions this in a follow-up Tweet, with a link).
 
A Tweet for Thought
 

Send Me Your Tools!

Made something? Send links via Direct Message on Twitter @WebToolsWeekly (details here). No tutorials or articles, please. If you have any suggestions for improvement or corrections, feel free to reply to this email.
 

Before I Go...

summarize.tech is an online tool that generates AI-powered summaries of YouTube videos. Might be helpful for doing research if you don't want to spend the time watching a full video. And it provides timestamps of the summary points which is handy for longer videos.

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
@WebToolsWeekly
PayPal.me/WebToolsWeekly

Older messages

Web Tools #487 - Autocomplete, CSS Tools, Build Tools, Uncats

Thursday, November 17, 2022

Web Tools Weekly WEB VERSION Issue #487 • November 17, 2022 Advertisement Turn Heads on Video with mmhmm Put yourself on screen with your slides. Move around for emphasis. Works with Zoom, Meet, and

Web Tools #486 - Future CSS, Frameworks, Media, React

Thursday, November 10, 2022

Web Tools Weekly WEB VERSION Issue #486 • November 10, 2022 Advertisement Get Early Access to TelemetryHub! TelemetryHub is an observability tool that collects all your complex telemetry data into a

Web Tools #485 - CSS Tools, Build Tools, React Native

Thursday, November 3, 2022

Web Tools Weekly WEB VERSION Issue #485 • November 3, 2022 Advertisement Stop Leaving Your // Todos for Dead 💀 Height's Code to Task feature automatically turns your // todo code comments into

Web Tools #484 - JS Libraries, Testing Tools, Uncats

Thursday, October 27, 2022

Web Tools Weekly WEB VERSION Issue #484 • October 27, 2022 Advertisement Get Early Access to TelemetryHub! TelemetryHub is an observability tool that collects all your complex telemetry data into a

Web Tools #483 - VSCode Updates, Frameworks, Git/CLI, JS Utils

Thursday, October 20, 2022

Web Tools Weekly WEB VERSION Issue #483 • October 20, 2022 Advertisement Meet the Tesla of Productivity Apps Sunsama helps you prioritize and focus on the work that matters, instead of dumping

You Might Also Like

Daily Coding Problem: Problem #1664 [Easy]

Friday, January 10, 2025

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Twitter. A permutation can be specified by an array P , where P[i] represents the

Spyglass Dispatch: The Case for a For-Profit OpenAI

Friday, January 10, 2025

RIP Venu • A More Political and Real Time Threads • An OpenAI Auction • Apple's Tough 2025 The Spyglass Dispatch is a newsletter sent on weekdays featuring links and commentary on timely topics

⌨️ 10 Mods to Improve Your Mechanical Keyboard — How to Set Up Quick Share on Windows

Friday, January 10, 2025

Also: Why Are Tech Companies Trying to Sell Me Expensive Clocks? How-To Geek Logo January 10, 2025 Did You Know Famed biologist Charles Darwin and US President Abraham Lincoln were born on the same day

Your best friends in design

Friday, January 10, 2025

​ Working With Designers Product manager & UX designer collaboration guide. How members of your product team work together is just as important as the work itself. A fundamental relationship within

Charted | How Canada Would Rank as the 51st State 📊

Friday, January 10, 2025

Donald Trump has floated the idea that Canada should be the 51st state. Here's how it compares statistically. View Online | Subscribe | Download Our App Presented by: Global X ETFs Power AI's

Pinpointing The Actual Problem 🎯

Friday, January 10, 2025

WordPress accidentally diagnoses its own business problem. Here's a version for your browser. Hunting for the end of the long tail • January 10, 2025 Pinpointing The Actual Problem A blog post from

😱Major Azure Outage in EastUS2, 🚀New AI and Azure Developer CLI Courses, azureedge.net DNS retiring

Friday, January 10, 2025

͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏

iOS Cocoa Treats

Friday, January 10, 2025

View in browser Hello, you're reading Infinum iOS Cocoa Treats, bringing you the latest iOS related news straight to your inbox every week. Adopting Swift 6 across the app codebase I've been

Issue #575: Excalibird, bird’s eye metropolis, and Stimulation Clicker

Friday, January 10, 2025

View this email in your browser Issue #575 - January 10th 2025 Weekly newsletter about Web Game Development. If you have anything you want to share with our community please let me know by replying to

22 CES products you can't miss

Friday, January 10, 2025

10 must-install Linux apps; Cybersecurity in 2025; Email encryption how-to -- ZDNET ZDNET Tech Today - US January 10, 2025 CES logo 2025 CES 2025: The 22 most impressive products you don't want to