
Research
/Security News
npm Malware Campaign Uses Adspect Cloaking to Deliver Malicious Redirects
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.
A folk version of the urlcat focuses on performance and simplicity. Build correct URLs easily. A fast, minimal fork of urlcat focused on performance and simplicity.
fast-url is a tiny JavaScript/TypeScript library that makes building URLs convenient and prevents common mistakes.
codePointAt for proper Unicode handling, including graceful encoding of lone surrogates# Using JSR (recommended for Deno)
deno add jsr:@hckhanh/fast-url
# Using bun
bun add fast-url
# Using npm
npm install fast-url
import { createUrl } from "fast-url";
// Path parameters
createUrl("https://api.example.com", "/users/:id", { id: 123 });
// → 'https://api.example.com/users/123'
// Query parameters
createUrl("https://api.example.com", "/users", { limit: 10, offset: 20 });
// → 'https://api.example.com/users?limit=10&offset=20'
// Combined path and query parameters
createUrl("https://api.example.com", "/users/:id/posts", { id: 123, limit: 10 });
// → 'https://api.example.com/users/123/posts?limit=10'
const { createUrl } = require("fast-url");
import { query, subst, join } from "fast-url";
// Build query strings
query({ name: "John", age: 30 });
// → 'name=John&age=30'
// Substitute path parameters
subst("/users/:id/posts/:postId", { id: 123, postId: 456 });
// → '/users/123/posts/456'
// Join URL parts
join("https://api.example.com/", "/", "/users");
// → 'https://api.example.com/users'
createUrl(baseUrl, pathTemplate, params?)Build a complete URL by combining a base URL, path template, and parameters.
createUrl(baseTemplate, params)Use a single template containing path parameters; unused params become query parameters.
query(params)Build a query string from an object of key-value pairs.
subst(template, params)Substitute path parameters in a template string.
join(part1, separator, part2)Join two URL parts with exactly one separator.
Building URLs manually is error-prone:
// ❌ Error-prone manual approach
const url = `${baseUrl}/users/${id}/posts?limit=${limit}&offset=${offset}`;
// Issues: double slashes, unescaped parameters, complex concatenation
// ✅ Clean and safe with fast-url
const url = createUrl(baseUrl, "/users/:id/posts", { id, limit, offset });
fast-url handles:
Contributions are welcome! Please feel free to submit a Pull Request.
MIT
FAQs
A folk version of the `urlcat` library focus on performance and simplicity.
We found that fast-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads