Issue #367 (ES String Methods, Frameworks, Testing, Uncats)
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 best way to describe them, of course, is by some code examples:
let myStringPS = 'apples',
myStringPE = 'oranges',
myStringTS = ' peaches ',
myStringTE = ' watermelons ';
myStringPS = myStringPS.padStart(15, 'Z');
myStringPE = myStringPE.padEnd(15, 'Z');
myStringTS = myStringTS.trimStart();
myStringTE = myStringTE.trimEnd();
console.log(myStringPS); // "ZZZZZZZZZapples"
console.log(myStringPE); // "orangesZZZZZZZZ"
console.log(myStringTS); // "peaches "
console.log(myStringTE); // " watermelons"
The most straightforward of these are the trimStart() and trimEnd() methods. Those do exactly what they imply: they remove any spaces from the start or end of a given string.
The other two methods, padStart() and padEnd() are not quite as clear. At first glance, you might think the passed in integer value (first argument) will add that number of the character used for the second argument. But that's not the case. The integer represents the desired total number of characters in the string after it is 'padded'. This means if your string is already higher than the number specified, then it won't add anything. Also, if you omit the second value, the pad methods will use a space character as the default:
let myStringPS2 = 'guacamole',
myStringPE2 = 'garbanzo';
myStringPS2 = myStringPS2.padStart(6, 'Z');
myStringPE2 = myStringPE2.padEnd(15);
console.log(myStringPS2); // Nothing added
console.log(myStringPE2); // "garbanzo "
As you can see, the first example wants to make the string 6 characters long. But it's already longer than that, so there are no characters added so it stays the same. The second example uses the space character to 'pad' the string up to a length of 15 (thus adding 7 spaces to the 8 existing characters).
You can try out all the examples in this CodePen.
The only major flaw in browser support is the fact that Edge uses nonstandard trimLeft() and trimRight() (instead of start/end), but that should be simple enough to patch up if you care about Edge support.
Now on to this week's tools!
Full Stack Starter Kit
A GraphQL-first full-stack starter kit built with Node, React, and powered by TypeScript.
An open source design system with dozens of components and layouts to choose from, built teams to build consistent UIs.
Wiki software with an intuitive interface, for building documentation pages.
A React toolkit that features 45+ components and is mostly meant for building "Shop Floor" apps that run in modern browsers on "Industrial Tablets".
From Microsoft, a suite of tools to build enterprise-grade websites, applications, components, design systems, and more.
Front-end framework with a built-in dark mode, designed for rapidly building beautiful dashboards and product pages.
Material Kit React
React UI kit based on the popular Material UI project.
Windows 95 UI Kit
30+ responsive components for building interfaces with a old Windows OS look.
An Electron boilerplate built with TypeScript, React, Jest, and ESLint.
The official Create React App template of React Boilerplate.
A lightweight and highly themeable CSS micro framework, specifically designed for small or medium-sized projects.
Testing and Debugging Tools
Create service monitors in seconds. This tool will automatically notify you if a service is unreachable.
Chrome extension that detects JSON responses in Chrome and converts them to a beautiful, lightweight interface.
An HTTP-based mock API simulator that helps simulate APIs for faster parallel development and more comprehensive testing.
A web analysis tool powered by Google Lighthouse that allows your team to monitor and analyze all pages of a website in one dashboard.
A test automation platform based on AI technology for regression and continuous testing, as well as monitoring of web applications.
Performance monitoring simplified. Receive alerts and insights in real time on website health and performance.
Enter a URL and this tool will tell you where the page is hosted.
Visually compare your code and designs. Compare your mockups with your live website to pinpoint any missing details.
An extremely fast and lightweight test runner for Node and the browser.
Internet Explorer as a service that runs a modern browser headlessly and draws a "canvas" of your site back to end users, for testing in old version of IE.
A curated collection of collection of free fonts from various platforms around the web.
A complete open source authentication solution for Next.js applications.
A powerful motion graphics tool that lets you turn amazing music visualizations into videos.
A command-line HTTP client that comes with JSON support, syntax highlighting, persistent sessions, wget-like downloads, plugins, and more.
Collect issues, ideas, etc. with a simple widget that you can add to your site. Email alerts notify you of feedback and you can view them in a dashboard.
Beautiful static documentation for your API.
A News API with flawless access to news information gathered from thousands of sources scattered all over the web.
Enable customizable, future-proof, passwordless login with a few lines of code.
A simple JSON poker API for calculating the winning hand in a game of Texas hold 'em.
Provides a geocoding and spatial database API to power your web and mobile applications.
A keyword generator that lets you produce every possible combination and permutation of your keywords to create thousands of longtail keywords that you can upload to your Google Ads campaign.