metrics-catalog-js

1.1.6 • Public • Published

MetricsCatalog.js

CircleCI npm minzipped size

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

  1. Download the repository.
  2. Get Node.js v12.16.3 and install it if you haven't already.
  3. Use npm install to install the necessary dependencies.
  4. The source code is written in TypeScript in the src directory.
  5. Run npm run build to build the library.
  6. Run npm test to run the tests.

Contribution

Pull requests and feature requests are welcome!

Author

Readme

Keywords

none

Package Sidebar

Install

npm i metrics-catalog-js

Weekly Downloads

7

Version

1.1.6

License

MIT

Unpacked Size

22.2 kB

Total Files

20

Last publish

Collaborators

  • dodothebird