@frankgqpeng/helloworld
v0.1.2
Published
A minimal CLI demo for learning npm publishing best practices.
Maintainers
Readme
@frankgqpeng/helloworld
A minimal CLI demo showcasing npm publishing best practices with TypeScript.
Features
- TypeScript source, compiled to CommonJS
dist/ - Both library API (
greet) and CLI binary (helloworld) - Type declarations (
.d.ts) shipped to consumers - Strict
fileswhitelist — onlydist/,README.md,LICENSEpublished prepublishOnlyruns lint + test + build, preventing broken releases
Installation
# As a CLI (global)
npm install -g @frankgqpeng/helloworld
# As a library
npm install @frankgqpeng/helloworldCLI Usage
helloworld # => Hello, world.
helloworld Alice # => Hello, Alice.
helloworld Alice --loud # => Hello, Alice!
helloworld --help
helloworld --versionOr run without installing:
npx @frankgqpeng/helloworld Bob --loudDevelopment
npm install # install devDependencies
npm run build # compile TypeScript -> dist/
npm test # run tests
npm run start # run the CLI locallyPublishing workflow (for maintainers)
# 1. Ensure working tree is clean and tests pass
npm test
# 2. Bump version (choose one)
npm version patch # 0.1.0 -> 0.1.1
npm version minor # 0.1.0 -> 0.2.0
npm version major # 0.1.0 -> 1.0.0
# 3. Dry-run to inspect what will be published
npm publish --dry-run
# 4. Publish (scoped packages default to private; --access public makes it public)
npm publish --access publicprepublishOnly automatically runs type-check, tests, and build before publish.
License
MIT
