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

Web Tools Weekly
WEB VERSION
What a Tool!

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've heard of the File API, which has full browser support. It's simple to use and can be used in conjunction with Drag and Drop or via a form input that accepts file uploads. For example,  let's say I have the following input element:

<input type="file" multiple>

This allows the user to select one or more files to add to the page. Once the files are added, the File API allows me to access the files to obtain various bits of information. For example:

myInput.addEventListener('change', function () {
  myFiles = myInput.files;
  console.log(myFiles[0].name);
  console.log(myFiles[0].size);
  console.log(myFiles[0].lastModified);
}, false);

This assumes my file input is referenced using the myInput variable. I'm listening for the change event, which allows the browser recognizes that files have been added to the input. Then I can access each file in the files object, which is a property of the input.

I've put together a slightly more complex live example that reads the name, size, and contents, and converts the modified date to a readable format (it's returned in Unix time).

When I read the contents I'm using the text() method, which is a method of the Blob interface and it returns a Promise. So I deal with that using something like the following:

myFiles[0].text().then((text) => {
  // do something with text here
});

You can view a full working version on CodePen here

For now, the easiest way to test out the demo is to add one or more text files. If you add another kind of file, it may crash the browser, as the code is attempting to read simple text. Notice that the info for each file added gets appended to the page.

Feel free to mess around with the demo, but that's the File API in a nutshell and should give you enough to get you started on using it if you haven't already done so.

Now on to this week's tools!
 

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

The Most Powerful CI/CD Tool
Automate your development process quickly, safely, and at scale. sponsored 

Screenshot.Rocks
Create beautiful browser and mobile mockups in seconds. Lets you customize the device, background canvas, then download as PNG, SVG, or JPEG.

Bumblebee
A JavaScript voice application framework. Write your own voice apps and assistants with an easy-to-learn JavaScript API.

Big Heads
Randomly generated characters for your apps and games. You can customize expressions, skin color, clothing, hair, etc., then grab the React or HTML code or download as SVG.

Big Heads

Free Illustrations
This is a directory of various free illustration sites, allowing you to filter by file type (AI, SVG, GIF, SKETCH, PNG, EPS, etc).

Shape Divider
Easily create and customize a page 'divider' (e.g. a curvy or wavy line/bg) then download the divider as SVG.

Patternico
Online tool to create and download seamless patterns in PNG format for use as backgrounds.

JZZ.js
A MIDI library for Node and web-browsers that hides asynchronous calls behind the developer-friendly chaining syntax.

React Flow
React library for building interactive node-based graph applications.

React H5 Audio Player
Accessible and keyboard-friendly React audio player component with consistent cross-browser UI/UX along with a time indicator that works on mobile.

Trails
A simple geometrical trail to attach to your Three.js objects.

SVG Path Visualizer
Enter SVG path data (the string inside the d attribute) to see a visual of it and along with an explanation of its parts.
 

JSON, Databases, etc.

PgTyped
Type safe SQL in TypeScript. Makes it possible to use raw SQL in TypeScript with guaranteed type safety.

Synchly
Automate database backups with customizable recurring schedules.

XgeneCloud
Instantly generate REST & GraphQL APIs on any Database for MySQL, PostgreSQL, MsSQL, SQLite, MariaDB, or Aurora.
 
XgeneCloud

static-json-db
The Native Jamstack Database. A NoSQL key-value database stored as a directory tree of small JSON files that can be deployed as part of a static website.

DatoJi
A tiny JSON storage service. Create, read, update, delete, .and search JSON data.

GraphQL Nexus
Declarative, code-first GraphQL schemas for JavaScript/TypeScript.

Draxlr
Admin, Explore and Analyze your data in one place. Perform CRUD operations, execute complex queries, save results, build graphs, dashboards, and more, all on a fully managed platform.

Visualize Your Database Schema
Automatically generate an interactive entity relationship diagram (ERD) from your existing SQL cloud database.

tzdb
Simplified, grouped and always up to date list of time zones, with major cities, in JSON format.

LinkPreview API
Preview web links with this Free API service that returns a JSON response for any URL.

Git, GitHub, and CLI Tools

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

Bach Testing Framework
A Bash testing framework that can be used to test scripts that contain dangerous commands like `rm -rf /`.

Streamhut
Share your terminal in real-time with anyone – without installing anything.

Streamhut


 

awesome-react-generator
A command line tool that lets you generate component files/folders without leaving your terminal.

GitHub Readme Stats
Dynamically generated stats for your GitHub Readme file. Just paste a markdown snippet into your source with the appropriate user name.

icdiff
By highlighting changes, this tool can show you the differences between similar files, helpful for identifying and understanding small changes.

scripthunter
CLI tool that finds JavaScript files for a given website. E.g. just run something like `./scripthunter.sh https://example.com` to find all scripts on the specified page.

GitPigeon
GitHub notifications delivered to your Mac for mentions, pull requests, CI/CD passed, etc.

GitHub-Defreshed
If you don't like the new GitHub repo layout, this Greasemonkey / Tampermonkey script brings back the old layout.

cli-alerts
Cross platform CLI Alerts with colors and colored symbols for success, info, warning, error. Work on macOS, Linux, and Windows.

SourceLevel
Connect your GitHub or GitLab account to automate your code review and see real-time team metrics to track your team's progress.

Super-Linter
A combination of 25+ linters that you can install as a GitHub action.

GitHub Dark Theme
Chrome or Firefox extension to add a dark theme to GitHub.

A Tweet for Thought

This tweet made me question all my domain-name-related decisions for the past 20 years.
 

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

Phuoc Nguyen has come up with yet another cool little front-end coding guide: this vs that, which provides links to various coding-related comparisons with explanations (e.g. argument vs. parameter, apply vs. call, :active vs. focus, etc).

Thanks to everyone for subscribing and reading!

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

Older messages

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

Web Tools #362 - Front-end Frameworks, React Tools, Build Tools

Thursday, June 25, 2020

Web Tools Weekly WEB VERSION Issue #362 • June 25, 2020 Advertisement Codacy: Automated Code Reviews Codacy is an automated code standardization platform that helps improve code quality, create

Web Tools #361 - JS Libraries, Testing Tools, Uncategorizables

Thursday, June 18, 2020

Web Tools Weekly WEB VERSION Issue #361 • June 18, 2020 Advertisement The New Tab Page You'll Actually Use Replace your web browser's gratuitous new tab page with a minimal list of links,

Web Tools #360 - React Tools, Git/CLI, JS Utilities

Thursday, June 11, 2020

Web Tools Weekly WEB VERSION Issue #360 • June 11, 2020 The following intro is a paid product review for NetNut, a fast residential proxy network for web scraping, SERP monitoring, and more. If your

You Might Also Like

📈 Why Is My Ping So High While Gaming? — How to Keep Your Android From Overheating

Saturday, May 4, 2024

Also: Using ChatGPT to Craft a Resume, and More! How-To Geek Logo May 4, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

JSK Daily for May 4, 2024

Saturday, May 4, 2024

JSK Daily for May 4, 2024 View this email in your browser A community curated daily e-mail of JavaScript news The Power of React's Virtual DOM: A Comprehensive Explanation Modern JavaScript

Daily Coding Problem: Problem #1431 [Medium]

Saturday, May 4, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by MongoDB. Given a list of elements, find the majority element, which appears more than

Ranked | The World's Top Media Franchises by All-Time Revenue 📊

Saturday, May 4, 2024

From Pokémon to Star Wars, some media franchises are globally recognizable. How do media franchises compare in terms of all-time revenue? View Online | Subscribe Presented by Voronoi: The App Where

Noonification: Read Code Like a Hacker With the SAST

Saturday, May 4, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech today, May 4, 2024? The HackerNoon Newsletter brings the HackerNoon

Weekend Reading — May the fourth

Saturday, May 4, 2024

This week we setup our new Minecraft server, play Spacewar, avoid burnout, wonder about Facebook AI spam, lose our passkeys, and claim stairs on the way back home. 😎 Labnotes (by Assaf Arkin) Weekend

Google lays off workers

Saturday, May 4, 2024

Plus: Tesla cans its Supercharger team and UnitedHealthcare reveals security lapses View this email online in your browser By Kyle Wiggers Saturday, May 4, 2024 Image Credits: Tomohiro Ohsumi / Getty

When It Rains, It Pours ☔

Saturday, May 4, 2024

Why the umbrella's design can't be beat. Here's a version for your browser. Hunting for the end of the long tail • May 04, 2024 Hey there, Ernie here with a refreshed piece about umbrellas

🐍 New Python tutorials on Real Python

Saturday, May 4, 2024

Hey there, There's always something going on over at realpython.com as far as Python tutorials go. Here's what you may have missed this past week: Python's unittest: Writing Unit Tests for

Microsoft Outlook Flaw Exploited by Russia's APT28 to Hack Czech, German Entities

Saturday, May 4, 2024

THN Daily Updates Newsletter cover Webinar -- Data Security is Different at the Petabyte Scale Discover the secrets to securing fast-moving, massive data sets with insights from industry titans