MetricsCatalog.js
metrics-catalog-js
is a tiny analytics library for collecting performance data such as TTFB, FCB etc.
Features
- Measures TTFB, FCP, DomContentLoaded and window Load events.
- Measures network timings for resources such as images, fonts, css, js etc.
- Works in all modern browsers.
- Sends those performance metrics to our API.
- Can be used in any web application.
- Small size < 1KB Gzipped.
Installation
- If you are using NPM:
npm install metrics-catalog-js
- You can also include the script directly. Just download the script from the dist folder.
Get started
- Usage with ES6 modules:
; const metricsCatalog = host: 'doganozturk.dev'; metricsCatalog;
- Usage in the browser (the
MetricsCatalog
global contains all of the functions):
Compatibility
- Every decent web browser (Chrome, Firefox, Safari, Opera, Microsoft Edge, IE11)
Examples
- See the demo.html file for a simple example.
Local development setup
- Download the repository.
- Get Node.js v12.16.3 and install it if you haven't already.
- Use
npm install
to install the necessary dependencies. - The source code is written in TypeScript in the
src
directory. - Run
npm run build
to build the library. - Run
npm test
to run the tests.
Contribution
Pull requests and feature requests are welcome!
Author
- Doğan Öztürk - Github