inferCliName
Generated reference page for the inferCliName function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/config/package-json.ts - Source link:
packages/dreamcli/src/core/config/package-json.ts:203
Signatures
ts
function inferCliName(pkg: PackageJsonData): string | undefined;Members
Members
inferCliName
Infer the CLI binary name from package.json data.
Resolution order:
- First key of
binobject (e.g.{"mycli": "./dist/cli.js"}→"mycli") - Package
namewith scope stripped (e.g."@scope/mycli"→"mycli") undefinedif neither exists
ts
(pkg: PackageJsonData): string | undefined;Examples
ts
import { inferCliName } from '@kjanat/dreamcli';
inferCliName({ bin: { mycli: './dist/cli.js' } }); // 'mycli'
inferCliName({ name: '@scope/mycli' }); // 'mycli'
inferCliName({ name: 'mycli' }); // 'mycli'
inferCliName({}); // undefined