Working with NPM
CodeScoring.Save implements npm Registry API with the /npm/<project>/<repository>/ prefix. It is compatible with standard npm, yarn, and pnpm clients.
Proxy Repository
Hosted Repository
Client Configuration
npm
For CI/CD, use a robot account: username = sa$<robot-name>, password = <api-key>. The .npmrc structure remains the same; only _auth changes (base64 of sa$<robot-name>:<api-key>). For details, see Authentication.
After npm adduser / npm login, the npm client stores the received opaque token and then uses it as Authorization: Bearer <token>. cs-auth classifies any non-JWT bearer token (a Bearer value without three dot-separated segments) as npm_token and validates it through service accounts linked to API keys.
Publishing to a hosted repository:
yarn
Yarn Classic (1.x)
Yarn 1.x uses the same .npmrc as npm:
Yarn 2+ (Berry)
In .yarnrc.yml:
pnpm
pnpm reads the same .npmrc:
For scoped packages, configure a separate registry:
Repository URL Migration
Use case: migrating an npm repository from Nexus / Artifactory to CodeScoring.Save.
During migration, it is enough to replace the URL in .npmrc/.yarnrc.yml. Existing Nexus/Artifactory credentials can be reused as Basic Auth.
