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

Function isBinaryOnlyPackage

shared/utils/binary-detection.ts:21–33  ·  view source on GitHub ↗
(pkg: PackageMetadata)

Source from the content-addressed store, hash-verified

19 * - Has bin field but no main, module, or exports fields
20 */
21export function isBinaryOnlyPackage(pkg: PackageMetadata): boolean {
22 // Check create-* patterns
23 if (isCreatePackage(pkg.name)) {
24 return true
25 }
26
27 // Has bin but no entry points
28 const hasBin =
29 pkg.bin !== undefined && (typeof pkg.bin === 'string' || Object.keys(pkg.bin).length > 0)
30 const hasEntryPoint = !!pkg.main || !!pkg.module || !!pkg.exports
31
32 return hasBin && !hasEntryPoint
33}
34
35/**
36 * Check if a package uses the create-* naming convention.

Callers 3

fetchPackagesFunction · 0.85

Calls 1

isCreatePackageFunction · 0.85

Tested by

no test coverage detected