Sign In

@tickhq/clean-url

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tickhq/clean-url

Strip tracking and clutter from URLs.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
166
24.81%
Maintainers
2
Weekly downloads
 
Created
Source

@tickhq/clean-url

This library strips unwanted tracking and clutter from URLs, making them simpler, tidier, and easier to read.

Install

pnpm add @tickhq/clean-url

Usage

import { clean, validateURL, Cleaner } from "@tickhq/clean-url";

// One-off clean (uses default rules)
const result = clean(
	"https://open.spotify.com/track/1hhZQVLXpg10ySFQFxGbih?si=-k8RwDQwTCK923jxZuy07w&utm_source=copy-link",
);
console.log(result.url);
// https://open.spotify.com/track/1hhZQVLXpg10ySFQFxGbih

// Validate a URL
validateURL("https://example.com"); // true
validateURL("not a url"); // false

// Custom config
const cleaner = new Cleaner({
	config: { allowAMP: false, allowRedirects: true },
});
const { url, info } = cleaner.clean("https://...");
console.log(info.removed); // params that were stripped

Options

  • Cleaner(options?)options.rules, options.handlers, options.config (partial) to override defaults.
  • cleaner.configallowAMP, allowCustomHandlers, allowRedirects. Use config.setMany({ ... }) to set multiple.

Build & test

pnpm run build
pnpm test   # run after build

Keywords

url

FAQs

Package last updated on 20 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts