Parse npm package specifiers into structured data.
npm supports multiple specifier formats:
lodash # name only (latest)
lodash@^4.0 # name with range
@scope/pkg@1.0 # scoped with range
npm:react@^18 # alias
file:../local # file reference
git+https://... # git reference
https://...tgz # URL tarball
Summary
Functions
Parse a package specifier string.
Check if a specifier targets the registry.
Format a spec back to a string like name@range.