What is Modernizr?

Modernizr is a package that detects browser features and makes them queriable via JavaScript and CSS. This is very handy to find out which CSS properties are supported, for example. The approach is much more flexible and stable than using browser vendor and version for this.

Using Modernizr with Nuxt.js

Modernizr uses a plugin-based architecture, and you have to build the package yourself, depending on the features you need to detect — at least if you are not using Nuxt.js! I have created the nuxt-modernizr module that makes it easy to add Modernizr to your Nuxt.js app. You pass the features as module options…


What Is Snapshot Testing?

Snapshot testing is a testing mechanism that for long has seemed to be exclusive to Jest. The main idea is to generate expected values into a separate file and to compare the actual tested values with these saved values. It is also possible to update snapshots by passing an environment variable. This testing approach is great for complex data like large strings, DOM content, or images.

Snapshot Testing with Jest

Snapshot testing itself is a built-in feature of Jest, and when searching specifically for image snapshots, you’ll quickly find jest-image-snapshot, which does great work comparing and updating image snapshots. …


Introduction

When I started to work with Nuxt.js, I frequently had the problem that I wanted so send emails via a contact form. While there are third party services to do that, I thought: Why not use the existing server infrastructure that comes with Nuxt.js?

That is why I wrote nuxt-mail, a Nuxt.js module that adds a /mail/send route to the server and injects a $mail variable that wraps the API call.

Usage

You start by installing the module and @nuxtjs/axios via npm install nuxt-mail @nuxtjs/axios or yarn add nuxt-mail @nuxtjs/axios.

@nuxtjs/axios is important here because it allows the module to do…

Sebastian Landwehr

I’m Sebastian Landwehr, a web developer from Bonn in Germany. My passion is all about JavaScript, Nuxt.js and Firebase.

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