Browse Source

add support for auth token

master
Jonathan Goldwasser 7 years ago
parent
commit
081a99d707
  1. 4
      cmd.js
  2. 1
      package.json

4
cmd.js

@ -7,6 +7,7 @@ const pkgDir = require('pkg-dir')
const readPackageTree = require('read-package-tree') const readPackageTree = require('read-package-tree')
const RegistryClient = require('npm-registry-client') // TODO: use npm-registry-fetch const RegistryClient = require('npm-registry-client') // TODO: use npm-registry-fetch
const registryUrl = require('registry-url') const registryUrl = require('registry-url')
const registryAuthToken = require('registry-auth-token')
const stripAnsi = require('strip-ansi') const stripAnsi = require('strip-ansi')
const textTable = require('text-table') const textTable = require('text-table')
@ -90,7 +91,8 @@ async function init () {
const opts = { const opts = {
timeout: 30 * 1000, timeout: 30 * 1000,
staleOk: true staleOk: true,
auth: registryAuthToken()
} }
return client.getAsync(url, opts) return client.getAsync(url, opts)
} }

1
package.json

@ -18,6 +18,7 @@
"pify": "^3.0.0", "pify": "^3.0.0",
"pkg-dir": "^2.0.0", "pkg-dir": "^2.0.0",
"read-package-tree": "^5.1.6", "read-package-tree": "^5.1.6",
"registry-auth-token": "^3.3.2",
"registry-url": "^3.1.0", "registry-url": "^3.1.0",
"strip-ansi": "^4.0.0", "strip-ansi": "^4.0.0",
"text-table": "^0.2.0" "text-table": "^0.2.0"

Loading…
Cancel
Save