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

🕹️ Retro Consoles Worth Collecting While You Still Can — Is Last Year's Flagship Phone Worth Your Money?

Saturday, November 23, 2024

Also: Best Outdoor Smart Plugs, and More! How-To Geek Logo November 23, 2024 Did You Know After the "flair" that servers wore—buttons and other adornments—was made the butt of a joke in the

JSK Daily for Nov 23, 2024

Saturday, November 23, 2024

JSK Daily for Nov 23, 2024 View this email in your browser A community curated daily e-mail of JavaScript news React E-Commerce App for Digital Products: Part 4 (Creating the Home Page) This component

Not Ready For The Camera 📸

Saturday, November 23, 2024

What (and who) video-based social media leaves out. Here's a version for your browser. Hunting for the end of the long tail • November 23, 2024 Not Ready For The Camera Why hasn't video

Daily Coding Problem: Problem #1617 [Easy]

Saturday, November 23, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. You are given an string representing the initial conditions of some dominoes.

Ranked | The Tallest and Shortest Countries, by Average Height 📏

Saturday, November 23, 2024

These two maps compare the world's tallest countries, and the world's shortest countries, by average height. View Online | Subscribe | Download Our App TIME IS RUNNING OUT There's just 3

⚙️ Your own Personal AI Agent, for Everything

Saturday, November 23, 2024

November 23, 2024 | Read Online Subscribe | Advertise Good Morning. Welcome to this special edition of The Deep View, brought to you in collaboration with Convergence. Imagine if you had a digital

Educational Byte: Are Privacy Coins Like Monero and Zcash Legal?

Saturday, November 23, 2024

Top Tech Content sent at Noon! How the world collects web data Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, November 23, 2024? The HackerNoon

🐍 New Python tutorials on Real Python

Saturday, November 23, 2024

Hey there, There's always something going on over at Real Python as far as Python tutorials go. Here's what you may have missed this past week: Black Friday Giveaway @ Real Python This Black

Re: Hackers may have stolen everyone's SSN!

Saturday, November 23, 2024

I wanted to make sure you saw Incogni's Black Friday deal, which is exclusively available for iPhone Life readers. Use coupon code IPHONELIFE to save 58%. Here's why we recommend Incogni for

North Korean Hackers Steal $10M with AI-Driven Scams and Malware on LinkedIn

Saturday, November 23, 2024

THN Daily Updates Newsletter cover Generative AI For Dummies ($18.00 Value) FREE for a Limited Time Generate a personal assistant with generative AI Download Now Sponsored LATEST NEWS Nov 23, 2024