MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / getCreatePackageSpecifier

Function getCreatePackageSpecifier

app/utils/install-command.ts:137–153  ·  view source on GitHub ↗
(options: ExecuteCommandOptions)

Source from the content-addressed store, hash-verified

135}
136
137function getCreatePackageSpecifier(options: ExecuteCommandOptions): string | null {
138 if (!options.isCreatePackage) {
139 return null
140 }
141
142 const shortName = getCreateShortName(options.packageName)
143 if (shortName === options.packageName) {
144 return null
145 }
146
147 if (options.packageManager === 'deno') {
148 // npm compatibility: npm:package-name
149 return `npm:${shortName}`
150 }
151
152 return shortName
153}
154
155export function getExecuteCommand(options: ExecuteCommandOptions): string {
156 return getExecuteCommandParts(options).join(' ')

Callers 1

getExecuteCommandPartsFunction · 0.85

Calls 1

getCreateShortNameFunction · 0.90

Tested by

no test coverage detected