painty

a First Meaningful Paint metric collector using Mutation Observer

Usage no npm install needed!

<script type="module">
  import painty from 'https://cdn.skypack.dev/painty';
</script>

README

painty Build Status npm version

A First Meaningful Paint metric collector based on MutationObserver with a setTimeout fallback

Usage

npm i -S painty
import painty from 'painty';

painty(fmp => console.log(fmp));

optionally you can specify a timeout or by default painty will try to detect FMP until page unload

painty(5000, fmp => console.log(fmp));