metrics-catalog-js
v1.1.6
Published
Metrics Catalog is a small web analytics tool to measure your client-side performance metrics.
Downloads
14
Readme
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:
import { MetricsCatalog } from 'metrics-catalog-js/dist/metrics-catalog.es.js';
const metricsCatalog = new MetricsCatalog({
host: 'doganozturk.dev',
});
metricsCatalog.init();
- Usage in the browser (the
MetricsCatalog
global contains all of the functions):
<script src="metrics-catalog.bundle.js"></script>
<script>
const metricsCatalog = new MetricsCatalog({
host: 'doganozturk.dev',
});
metricsCatalog.init();
</script>
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