0.3.4 • Published 1 year ago

ping-tracker v0.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Ping Tracker

Ping Tracker logo

npm version npm TypeScript version Tree shaking Dependencies Gzipped Commits Issues License Follow GitHub Sponsors

Ping Tracker is a tiny library that adds ping attribute to all <a> tags on the site with customizable list of URLs.

Features

  • 🏓 Add ping attribute to all <a> tags automatically
  • 👀 Watch for changes using MutationObserver to modify newly added links
  • 📝 Customize the content of the ping tag (list of URLs)
  • ⚡️ Tiny library (2.7kB minified, 1.2kB gzipped)
  • 📭 No dependencies
  • 🌳 Tree-shakeable
  • 🔥 Written in TypeScript

Installation

npm i ping-tracker

Usage

import { PingTracker } from "ping-tracker";

const pt = new PingTracker("https://analytics.example.com");

// Or with options

const pt = new PingTracker("https://analytics.example.com", {
    hrefToQuery: false,
    onlyExternal: false,
    watchDOM: true,
    elementsToWatch: document.body,
});
0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago