@frankgqpeng/helloworld-go
v0.1.0
Published
A Go-powered hello-world CLI distributed via npm with platform-specific binaries.
Maintainers
Readme
@frankgqpeng/helloworld-go
A Go-powered helloworld CLI, distributed via npm with per-platform native binaries.
Install
npm install -g @frankgqpeng/helloworld-go
# or run ad-hoc:
npx @frankgqpeng/helloworld-go Alice --loudnpm auto-selects the correct platform package for your machine. Supported:
| OS | CPU | |---------|-------| | Linux | x64 | | Linux | arm64 | | macOS | x64 | | macOS | arm64 | | Windows | x64 | | Windows | arm64 |
Usage
helloworld # Hello, world.
helloworld Alice # Hello, Alice.
helloworld Alice --loud # Hello, Alice!
helloworld --version
helloworld --helpHow it works (brief)
- The Go binary is compiled ahead of time for each supported platform.
- Each platform binary ships as its own npm package with
os+cpufields, so npm only downloads the one matching your machine. - The main package declares all platform packages as
optionalDependencies. npm silently skips the non-matching ones. bin/helloworld.jsis a thin Node launcher that resolves the installed platform package andspawns the binary, forwarding stdio and exit code.
