diff --git a/cmd.js b/cmd.js index 1a9ade5..4783a07 100755 --- a/cmd.js +++ b/cmd.js @@ -7,6 +7,7 @@ const pkgDir = require('pkg-dir') const readPackageTree = require('read-package-tree') const RegistryClient = require('npm-registry-client') // TODO: use npm-registry-fetch const registryUrl = require('registry-url') +const registryAuthToken = require('registry-auth-token') const stripAnsi = require('strip-ansi') const textTable = require('text-table') @@ -90,7 +91,8 @@ async function init () { const opts = { timeout: 30 * 1000, - staleOk: true + staleOk: true, + auth: registryAuthToken() } return client.getAsync(url, opts) } diff --git a/package.json b/package.json index f10702e..f0ef52a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "pify": "^3.0.0", "pkg-dir": "^2.0.0", "read-package-tree": "^5.1.6", + "registry-auth-token": "^3.3.2", "registry-url": "^3.1.0", "strip-ansi": "^4.0.0", "text-table": "^0.2.0"