Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 560 Bytes

README.md

File metadata and controls

14 lines (9 loc) · 560 Bytes

Remove Common URL Tracking Parameters

This package provides a function to remove tracking parameters from URLs. It supports both predefined tracking parameters and custom parameters specified by the user.

Usage

import { removeTrackingParams } from 'jsr:@nbbaier/remove-tracking-parameters';

const originalUrl = new URL('https://example.com?utm_source=newsletter&utm_medium=email&customParam=123');
const cleanedUrl = removeTrackingParams(originalUrl, ['customParam']);

console.log(cleanedUrl.toString());
// Output: https://example.com