view: always fetch fullMetadata, and preferOnline · npm/cli@ef8f567 (original) (raw)

Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ const completion = async (opts, cb) => {
29 29 return cb()
30 30 }
31 31 // have the package, get the fields
32 -const config = npm.flatOptions
32 +const config = { ...npm.flatOptions, fullMetadata: true, preferOnline: true }
33 33 const { defaultTag } = config
34 34 const spec = npa(opts.conf.argv.remain[2])
35 35 const pckmnt = await packument(spec, config)
@@ -63,7 +63,7 @@ const completion = async (opts, cb) => {
63 63 const view = async args => {
64 64 if (!args.length) args = ['.']
65 65
66 -const opts = npm.flatOptions
66 +const opts = { ...npm.flatOptions, preferOnline: true, fullMetadata: true }
67 67 const pkg = args.shift()
68 68 let nv
69 69 if (/^[.]@/.test(pkg)) {
@@ -97,11 +97,7 @@ const fetchAndRead = async (nv, args, opts) => {
97 97 // get the data about this package
98 98 let version = nv.rawSpec |
99 99
100 -const pckmnt = await packument(nv, {
101 - ...opts,
102 -fullMetadata: true,
103 -'prefer-online': true
104 -})
100 +const pckmnt = await packument(nv, opts)
105 101
106 102 if (pckmnt['dist-tags'] && pckmnt['dist-tags'][version]) {
107 103 version = pckmnt['dist-tags'][version]