Latest Software Version (latest-version) #
Queries official registries to find stable package versions. Do not guess versions or rely on outdated knowledge.
Available scripts #
scripts/latest.jsโ Queries official package registries (npm, PyPI, Go proxy, Cargo, RubyGems) and Gemini models for stable versions.
How to Use #
1. Find the Ecosystem #
We support these registries:
npm: Node.js/JSpypi: Pythongo: Gocargo: Rustgem: Rubygemini: Gemini models (use 'latest', 'flash', 'pro', or brand names as the name)
2. Run the Command (Node.js 18+) #
Execute the bundled helper script with one or more package names. You can append the --json flag to receive structured JSON results:
node scripts/latest.js <ecosystem> <package-name1> [package-name2]... [--json]
3. Save the Version #
Write the returned version constraint to your configuration file (such as package.json, requirements.txt, go.mod, etc.).
Gotchas & Edge Cases #
- Go Proxy Capitalization (Severe): The standard Go module proxy (
proxy.golang.org) is case-sensitive and requires uppercase letters in module paths (e.g.Sirupsen) to be encoded with exclamation marks (!sirupsen). While the script handles this automatically, remain alert to this rule when auditing manual package layouts. - Scoped NPM Packages: NPM scoped packages (e.g.,
@types/nodeor@google/genai) must include the@symbol when passed as command arguments. - PyPI Name Normalization: PyPI treats underscores and hyphens interchangeably in registry lookups (e.g.,
pip-installvspip_install), but Python codeimportstatements must strictly match the code namespace. Ensure you do not write invalid Python import syntax.
Warning Action Rules #
When a dependency is flagged with warnings by latest.js (e.g., deprecated, yanked, retracted, or archived):
- Halt Execution: Stop the writing process immediately.
- Report Details: Present the exact deprecation, retraction, or yanked reason returned by the script directly to the user.
- Propose Alternatives: Query registry alternatives or request user instructions before writing any flagged or insecure packages to project configurations.
Validation Loop #
When updating dependencies, follow this strict loop to prevent breaking the build:
graph TD
A[Start: Request Package] --> B[Run node scripts/latest.js]
B --> C{Warnings / Errors?}
C -->|Yes| D[Stop & Propose Alternatives / Query User]
C -->|No| E[Write Version to Configuration File]
E --> F[Run Local Package Tidy/Install]
F --> G{Compilation Success?}
G -->|No| H[Backtrack / Query Lower Version Constraint]
H --> E
G -->|Yes| I[Complete Task & Save Lockfile]