I've got a script that verifies a user has logged into a private npm registry (via "npm login") by greping for:
//registry-sub-url:_authToken=
... in:
~/.npmrc
However, this breaks down over time as the user's credentials expire (due to standard password expiration rules).
What's more, the helper scripts I've created have cannot differentiate between successful/failed npm login calls, since the script always exits with 0 status.
Q: (1) How do we verify that npm login succeeded? (2) How do identify when the npm token has expired?