packageurl-jsoverride by Socket

Generated from multiline source comments in Part Plan order.

Topics: Anatomy Building Parsing Validation URL Ecosystems Comparison Security Architecture Builders Contributing Converters Hardening Release Tour VERS

Published on npm as @socketregistry/packageurl-js — a Socket Optimized override of the upstream packageurl-js.

npm install @socketregistry/packageurl-js

Topics

Anatomy of a PURL

Understand the pkg:type/ns/name@version?q#sub shape and how it maps to the PackageURL class.

codelarge
Building & Stringifying PURLs

Build PURLs with the fluent PurlBuilder API; serialize back to canonical pkg:... string form.

codemedium
Parsing & Normalization

Percent-encoding, name/namespace normalization, and the known-qualifiers catalogue.

codesmall
Validation, Errors & Results

Shape + format validation, the Result<T, E> functional error pattern (Ok/Err/ResultUtils), typed errors (PurlError, PurlInjectionError), and per-ecosystem rule plumbing.

codelarge
URL ↔ PURL Conversion

Convert between repository/download URLs and PURLs — ~25 ecosystem URL parsers.

codelarge
Ecosystems

Per-ecosystem normalize/validate/encode rules across all 41 supported package ecosystems.

codex-large
Comparison, Matching & Existence

Compare + equal + match PURLs with wildcard patterns (ReDoS-protected); registry existence checks.

codemedium
Security Primitives & VERS

Injection-character detection for safe PURL handling, safe object freezing, and VERS — the pre-standard version-range specifier slated for ECMA submission in late 2026.

codelarge
Architecture

Module map, data flow, and the key abstractions that keep the library small.

articlesmall
Builders

The PurlBuilder fluent API — construct a PackageURL step by step with per-field setters and per-ecosystem factories.

articlesmall
Contributing

Dev setup, test layout, the parallel-sessions git workflow, and the full pre-PR checklist.

articlesmall
Converters

URL ↔ PURL conversion across ~25 ecosystems.

articlesmall
Hardening

How the library treats PURL strings as hostile input — injection-character detection, frozen instances, and a strong protective stance.

articlesmall
Release

Publish flow — npm trusted publishing, provenance attestations, Socket.dev post-publish audit, and common release scenarios.

articlesmall
Tour

How the tour site is built, from meander submodule through post-process to GitHub Pages deploy.

articlemedium
VERS

Version-range specifiers — the pre-standard grammar slated for ECMA submission in late 2026.

articlesmall