Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![npm downloads](https://img.shields.io/npm/dm/regxa?style=flat&colorA=130f40&colorB=474787)](https://npm.chart.dev/regxa)
[![license](https://img.shields.io/github/license/oritwoen/regxa?style=flat&colorA=130f40&colorB=474787)](https://github.com/oritwoen/regxa/blob/main/LICENSE)

> Query npm, PyPI, crates.io, RubyGems, and Packagist with one API. PURL-native, typed, cached.
> Query npm, PyPI, crates.io, RubyGems, Packagist, and Arch Linux with one API. PURL-native, typed, cached.

## Why?

Expand All @@ -16,7 +16,7 @@ regxa fills that gap. One `fetchPackage` call, same response shape, regardless o

## Features

- 🔍 **Single API, five registries** — npm, PyPI, crates.io, RubyGems, Packagist
- 🔍 **Single API, six registries** — npm, PyPI, crates.io, RubyGems, Packagist, Arch Linux (official + AUR)
- 📦 **PURL-native** — [ECMA-427](https://github.com/package-url/purl-spec) identifiers as first-class input
- 🏷️ **Normalized data model** — same `Package`, `Version`, `Dependency`, `Maintainer` types everywhere
- 💾 **Storage-backed cache + lockfile** — unstorage-native, sha256 integrity checks, configurable TTL
Expand Down Expand Up @@ -52,6 +52,7 @@ await fetchPackageFromPURL('pkg:cargo/serde')
await fetchPackageFromPURL('pkg:pypi/flask')
await fetchPackageFromPURL('pkg:gem/rails')
await fetchPackageFromPURL('pkg:composer/laravel/framework')
await fetchPackageFromPURL('pkg:alpm/arch/pacman')
```

### CLI
Expand All @@ -63,6 +64,7 @@ regxa info npm/lodash
regxa versions cargo/serde
regxa deps pypi/flask@3.1.1
regxa maintainers gem/rails
regxa deps alpm/aur/paru
```

Add `--json` for machine-readable output, `--no-cache` to skip the cache.
Expand All @@ -76,9 +78,12 @@ Add `--json` for machine-readable output, `--no-cache` to skip the cache.
| PyPI | `pkg:pypi/...` | pypi.org |
| RubyGems | `pkg:gem/...` | rubygems.org |
| Packagist | `pkg:composer/...` | packagist.org |
| Arch Linux | `pkg:alpm/...` | archlinux.org, aur.archlinux.org |

Scoped packages work as expected: `pkg:npm/%40vue/core` or `npm/@vue/core` in the CLI.

Arch Linux packages use a namespace: `pkg:alpm/arch/pacman` (or just `pkg:alpm/pacman`) for official repos, `pkg:alpm/aur/paru` for AUR. Official packages default to `arch` when the namespace is omitted; AUR requires the explicit `aur` namespace.

## API reference

### PURL helpers
Expand Down
4 changes: 4 additions & 0 deletions src/core/purl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export function parsePURL(purlStr: string): ParsedPURL {
name = name.toLowerCase().replace(/_/g, '-')
}

if (type === 'alpm') {
name = name.toLowerCase()
}

return { type, namespace, name, version, qualifiers, subpath }
}

Expand Down
Loading