Web Tools #368 - JS Utilities, SVG Tools, Git/CLI

Web Tools Weekly
WEB VERSION
What a Tool!

Issue #368 • August 6, 2020

ES6 introduced the somewhat overlooked .entries() method for Array, Map, and Object. The concept for this method is the same for all three, but in this intro I'll focus on its use with arrays.

As explained on MDN, the "entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array."

This is useful for matching an array element's value to the index in the array. For example, a for...of loop iterates through the elements. I can combine for...of with Array.entries() to directly relate the values to their indexes.

let myArray = ['fruit', 'fish', 'seahorses', 'mudslides'];

for (let [index, value] of myArray.entries()) {
 
console.log(index, value);
}

/*
0 "fruit"
1 "fish"
2 "seahorses"
3 "mudslides"
*/

Try it on CodePen

The above example also uses destructuring assignment to grab the key/value pairs (or, to be more specific the index/value pairs). The destructuring takes place where you see the square brackets before the word 'of' in the loop head. This allows me to extract the values on each iteration without the need for any fancy conditionals or other clutter. You can see how both the index and the value are logged with minimal code.

As mentioned, entries() exposes an iterator object. This object also opens up use of the next() method, which itself returns an object. For example if I was using Array.entries() without a loop, I could move through the items like this:

let myArray = ['fruit', 'fish', 'seahorses', 'mudslides'],
   
myIterator = myArray.entries();

console.log(myIterator.next().value); // [0, "fruit"]
console.log(myIterator.next().value); // [1, "fish"]
console.log(myIterator.next().value); // [2, "seahorses"]
console.log(myIterator.next().value); // [3, "mudslides"]

Try it on CodePen

Each time I use next(), the iterator moves to the next item. As you can see, I don't have to make any kind of special request for the index of each item; it's just there, along with the array entry.

Did you like this JavaScript tip? I've collected together tons of similar tips with 200+ CodePen demos in my JS/DOM E-Books Bundle.

Now on to this week's tools!

JavaScript Utilities

Isdis
A key/value storage library to cache requests with LocalStorage.

Bueno
A tiny, composable validation library that aims to be an improvement on older form validation libraries, but can also be used as a lightweight API validation library.

routeward
Provides an easy, relatively literate, declarative way to generate helper methods that return the URL paths your app relies on.

tinykeys
A tiny (~400b) modern library for keybindings. Includes examples you can try right on the page.

Inclusive Dates
A human friendly date picker module that lets the user pick dates using natural-language phrases like 'tomorrow' or 'in 5 days'.
 
Inclusive Dates

Taap
A lightweight zero dependency Typescript type checking library that coerces unknown value types. More concise and accurate than typeof checks, etc.

Super Expressive
A zero-dependency JavaScript library for building regular expressions in (almost) natural language.

DataGridXL
A performant and reliable vanilla JavaScript data grid with Excel-like controls.

Moufette
An embeddable JavaScript widget to collect user feedback and user votes on upcoming features. Includes a dashboard to view feedback and customize.

Vest
A validations library for JavaScript apps that derives its syntax from modern unit testing frameworks like Mocha or Jest.

turven
Lets visitors on a website see how many other people are also reading the same page.

Overmind
A frictionless state management library with a focus on the developer experience.

js-coroutines
Run complex calculations on your app while maintaining 60fps for a smooth and interactive experience.

Media Tools (SVG, Audio, Video, etc.)

Tech Productivity
A brief weekly newsletter for tech professionals. Features articles, tips, and tools for improved productivity.   promoted

Ara
Free illustration creator with more than 120+ illustrations, allowing you to create your own illustration scene compositions.

RecordRTC
A WebRTC JavaScript library for audio/video as well as screen activity recording.

Forge Icons
A set of 300+ SVG icons ideal for e-Commerce, travel, social media, and more.
 
Forge Icons

Pikwizard
Library of over 1 million stock images and videos. Royalty free and safe for commercial use, with no attribution required.

Black Illustrations
Beautiful, free illustrations of black people for your next digital project.

Warp SVG
Online tool that lets you add an SVG file that you can then warp, skew by grabbing node/handles on the SVG. Then you can save the result as a new SVG.

tsParticles
A lightweight, dependency-free TypeScript library for creating particles, based on the old particles.js project.

XP Paint
A web version of MS Paint from Windows XP. Lets you save as PNG when you're done drawing.

AudioMass
A free web-based audio and waveform editor that runs entirely in the browser with no back end or plugins required.

svg-to-react
A utility to convert raw SVG files into accessible and extendable React components.

BrowserFrame
The easiest way to wrap screenshots in browser frames. Supports multiple browsers, operating systems, and themes.
 

Git, GitHub, and CLI Tools

FrontAid CMS
A decoupled and Git-based content management system that stores content in your own Git repository in JSON format.

GitHub Profile README Generator
A wizard-like page that lets you create a GitHub readme in Markdown format that you can use as your GitHub profile.

Bashō
A JavaScript evaluator for shell scripts. Lets you write complex shell tasks using plain JavaScript and mixes well with shell commands and scripts so you can choose the best tool for the job.

Runme
Generates a "runme" button to embed in your GitHub repo so you can run your application from any public repo with one click.
 
Runme

Simple Bash Prompt
A simple bash prompt modeled after a popular Python-based shell prompt, but this one is pure bash.

Profiled
Generates a beautiful, organized portfolio from the info in your GitHub account in seconds.

import
A simple and fast module system for Bash and other Unix shells.

watchlist
Recursively watch a list of directories and run a command on any file system changes.

Sigmetic
A toolkit that collects data from your GitHub organization and provides a full picture of habits and trends, detects and diagnoses destructive practices, etc.

githubbox
Quickly open any GitHub repo in CodeSandbox. Visit any GitHub repo and replace github.com with githubbox.com.

mdjs-viewer
Allows you to execute code and show interactive demos within your markdown documentation on a GitHub readme or in GitHub issues.

A Tweet for Thought

This cartoon from the Daily Mirror, England from January 23, 1923 is about mobile phones!
 

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...

(Warning, this link contains multiple flashing animations). If you used to play or write games in Flash, you'll enjoy this little trip down memory lane: How Flash Games shaped the video game industry.

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
webtoolsweekly.com
@WebToolsWeekly
PayPal.me/WebToolsWeekly

Older messages

Web Tools #367 - Front-end Frameworks, Testing Tools, Uncats

Thursday, July 30, 2020

Web Tools Weekly WEB VERSION Issue #367 • July 30, 2020 In case you missed it, a couple of new String methods have been added in ES2017 and ES2019 and they all have pretty decent browser support. The

Web Tools #366 - Fetch API, CSS Tools, React, CMS's

Thursday, July 23, 2020

Web Tools Weekly WEB VERSION Issue #366 • July 23, 2020 Advertisement Breakpoints and `console.log` is the Past, Time Travel is the Future Wallaby.js is a developer productivity tool that runs your

Web Tools #365 - File API, Media Tools, JSON, Git/CLI

Friday, July 17, 2020

Web Tools Weekly WEB VERSION Issue #365 • July 16, 2020 Advertisement The Most Powerful CI/CD Tool Automate your development process quickly, safely, and at scale. Sign Up CircleCI I'm sure you

Web Tools #364 - Testing Tools, Text Editors/IDEs, Uncategorizables

Thursday, July 9, 2020

Web Tools Weekly WEB VERSION Issue #364 • July 9, 2020 Advertisement The Most Powerful CI/CD Tool Automate your development process quickly, safely, and at scale. Sign Up CircleCI In addition to this

Web Tools #363 - CSS Tools, Media, JS Utilities

Thursday, July 2, 2020

Web Tools Weekly WEB VERSION Issue #363 • July 2, 2020 Advertisement Managing Complexity in Adopting Microservices July 8 @ 10 AM PT | 5 PM UTC Join Rollbar, Optimizely, Postman, and DeployHub for an

You Might Also Like

Daily Coding Problem: Problem #1668 [Easy]

Tuesday, January 14, 2025

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. A number is considered perfect if its digits sum up to exactly 10. Given a

Django vs FastAPI, Interacting With Python, Data Cleaning, and More

Tuesday, January 14, 2025

Django vs. FastAPI, an Honest Comparison #664 – JANUARY 14, 2025 VIEW IN BROWSER The PyCoder's Weekly Logo Django vs. FastAPI, an Honest Comparison David has worked with Django for a long time, but

🤖 Yes, I Do Want a Drink-Carrying Robot — The Best Way to Give Old TVs Bluetooth

Tuesday, January 14, 2025

Also: How to Prevent Your Computer From Waking Up Accidentally, and More! How-To Geek Logo January 14, 2025 Did You Know Except for the letter Q, every letter of the alphabet shows up in the names of

Charted | AI's Perceived Impact on Job Creation, by Country 🔮

Tuesday, January 14, 2025

This chart presents Ipsos survey results on whether people believe AI will create many new jobs in their country. View Online | Subscribe | Download Our App Presented by Hinrich Foundation NEW REPORT:

HackerNoon Decoded: How Users Searched in 2024

Tuesday, January 14, 2025

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, January 14, 2025? The

Hack Your Python Roadblocks -- Just 5 Seats Left

Tuesday, January 14, 2025

Hi there, A quick update: after last week's announcement, the Intermediate Python Deep Dive live course is almost full. We're down to just 5 spots left for the February cohort, and once they

Spyglass Dispatch: TikTok & Twitter

Tuesday, January 14, 2025

Sonos Switch • MySports Streaming • Amazon's Alexa Brain Freeze • Billionaire-Free Social Media • EU Backs off Big Tech The Spyglass Dispatch is a newsletter sent on weekdays featuring links and

5 AI Predictions for 2025 (AI hype dying; real opportunities rising)

Tuesday, January 14, 2025

plus, a new study: AI Economy = $15 trillion. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Power BI Weekly #291 - 14th January 2025

Tuesday, January 14, 2025

Power BI Weekly Newsletter Issue #291 powered by endjin Welcome to the 291st edition of Power BI Weekly! No official Power BI blogs yet, so let's dive into the community articles. To start, Eugene

LW 165 - How Shopify Built Its Live Globe for Black Friday

Tuesday, January 14, 2025

How Shopify Built Its Live Globe for Black Friday ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ Shopify Development news and articles Issue 165