A tiny library for simple web components.

Native Web
Native Web

There are many popular web app frameworks out there. But if you’re building a website, like a blog, a portfolio or a company site, where do you start these days?

The cost

Most people will go with one of these big frameworks. One they are comfortable with. But at what cost? It might cost you slower load times with all these kB added to your pages for features you won’t use. And it might add complexity where you don’t need, with these pages and pages of documentation you’ll have to learn, especially if you are starting out.

Vanilla

So vanilla HTML, CSS and…


Image for post
Image for post

You should be using SVG favicons. They’re supported in all modern browsers right now.

Also, you probably don’t need all these icon links and sizes you’re copying from projects to projects. Let’s find out what’s the absolute minimum required, word by word.


Image for post
Image for post

There are countless ways to iterate through JS objects and arrays. Here’s how to do it in the simplest way, with ES6 and beyond, for each purpose.

Objects

Keys and values

Loop through keys and values of an object.

Keys

Loop through keys of an object.

Values

Loop through values of an object.

Arrays

Loop through an array.

Return

If you want to return the items or the whole loop, you have to swap the forEach for a map. You can change it in any of the examples above, it will work as expected, and the result will be returned. A forEach will always return undefined.


Image for post
Image for post

Build a simple Node.js CLI tool without any dependencies. A single command to clone and install a repository.

Don’t make me install your CLI

Npm has a great command called init. Running the command npm init <something> temporarily installs a package you named create-<something> to run its main entry. It uses npx under the hood, but with a more familiar command.

One significant advantage of init is that it always uses the latest version of your package; you don’t have to update it manually as you would have to globally. But it still works, you can install the package globally if you prefer.

The package

To get started…

Antoine Boulanger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store