[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: show command to install a specific version (#7)

authored by

Luke Nelson and committed by
GitHub
657b2cbf 32088fce

+10 -3
+10 -3
app/pages/package/[...name].vue
··· 168 168 const installCommand = computed(() => { 169 169 if (!pkg.value) return '' 170 170 const pm = currentPM.value 171 + let command = `${pm.label} ${pm.action} ${pkg.value.name}` 171 172 // deno uses "add npm:package" format 172 173 if (pm.id === 'deno') { 173 - return `${pm.label} ${pm.action}${pkg.value.name}` 174 + command = `${pm.label} ${pm.action}${pkg.value.name}` 174 175 } 175 - return `${pm.label} ${pm.action} ${pkg.value.name}` 176 + if (requestedVersion.value) { 177 + command += `@${requestedVersion.value}` 178 + } 179 + return command 176 180 }) 177 181 178 182 // Copy install command ··· 517 521 >&nbsp;{{ pkg.name }}</span><span 518 522 v-else 519 523 class="text-fg-muted" 520 - >{{ pkg.name }}</span><template #fallback><span class="text-fg">npm</span>&nbsp;<span class="text-fg-muted">install {{ pkg.name }}</span></template></ClientOnly></code> 524 + >{{ pkg.name }}</span><span 525 + v-if="requestedVersion" 526 + class="text-fg-muted" 527 + >@{{ requestedVersion }}</span><template #fallback><span class="text-fg">npm</span>&nbsp;<span class="text-fg-muted">install {{ pkg.name }}</span></template></ClientOnly></code> 521 528 </div> 522 529 </div> 523 530 <button