Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@url-sanitize/clearurls

ClearURLs-compatible rule catalog and adapter for @url-sanitize/core. Use it to remove tracking parameters such as utm_* and fbclid, and to unwrap known tracking redirectors.

Ships a snapshot of the ClearURLs ruleset, daily-synced from upstream https://rules2.clearurls.xyz/data.minify.json with SHA256 verification.

For the default v2 multi-source behavior, use @url-sanitize/merged.

Install

npm install @url-sanitize/core @url-sanitize/clearurls

Usage

import { compileSanitizer } from '@url-sanitize/core';
import { clearurlsCatalog } from '@url-sanitize/clearurls';

const sanitize = compileSanitizer(clearurlsCatalog);
sanitize('https://example.com/?utm_source=x');

Raw access

If you need the unprocessed ClearURLs JSON shape (for custom adapters or tooling), use the secondary entrypoint:

import { clearurlsRawData, clearurlsMetadata } from '@url-sanitize/clearurls/raw';

If you only need the adapter without importing the bundled snapshot, use:

import { clearurlsToCatalog } from '@url-sanitize/clearurls/adapter';

License

  • src/ (adapter, types) — MIT
  • data/data.json (bundled ClearURLs ruleset) — LGPL-3.0-only

See LICENSE and NOTICE.