repomatic.npm module

npm registry API integration.

The npm counterpart to repomatic.pypi, used by sync-workflow-pins to resolve the npm version literals embedded in workflow YAML (like npm install awesome-lint@2.3.0).

repomatic.npm.NPM_PACKAGE_URL = 'https://www.npmjs.com/package/{package}'

npm package homepage URL. The npm counterpart to repomatic.pypi.PYPI_PACKAGE_URL.

repomatic.npm.NPM_REGISTRY_URL = 'https://registry.npmjs.org/{package}'

npm registry metadata URL for a package.

repomatic.npm.get_release_dates(package)[source]

Get publication dates for all versions of an npm package.

Parameters:

package (str) – The npm package name (e.g. awesome-lint).

Return type:

dict[str, str]

Returns:

Dict mapping version strings to YYYY-MM-DD publication dates. Empty if the package is not found or the request fails.