Created Files:
-
package.json- npm package manifest with:- Package name:
lofetch - Version:
2.0.0 - Binary:
lofetchcommand - Supports both global install (
npm install -g) and npx - Files included: lofetch, README.md, LICENSE, CHANGELOG.md
- Package name:
-
.npmignore- Excludes dev files from npm package:- Test files
- Formula directory
- CI/CD configs
- IDE files
- Legacy files
Created Files:
Formula/lofetch.rb- Homebrew formula for macOS/Linux installation- References GitHub releases
- Installs to system bin directory
- Includes test command
Created Files:
-
INSTALL.md- Comprehensive installation guide:- npm installation (global & npx)
- Homebrew installation
- Manual installation
- Troubleshooting
-
PUBLISH.md- Publishing guide for maintainers:- Version update checklist
- npm publishing steps
- Homebrew formula updates
- Testing procedures
-
INSTALLATION_SUMMARY.md- This file!
Updated Files:
README.md- Added npm and Homebrew quick start instructions
Created Files:
test_package.sh- Package structure tests (16 assertions):- Validates package.json
- Checks bin references
- Tests --version flag
- Verifies Homebrew formula syntax
- Ensures required files exist
Updated Files:
Makefile- Added targets:make test-package- Run package testsmake test-all- Run all testsmake help- Show available targets
The following were already implemented (no changes needed):
--versionflag (line 728-729 in lofetch)show_version()function (line 700-702)LOFETCH_VERSIONconstant (line 12)
Main Tests: 110 passed, 0 failed ✅
Package Tests: 16 passed, 0 failed ✅
Total: 126 passed, 0 failed ✅
# Test npm pack (dry run)
npm pack
tar -tzf lofetch-2.0.0.tgz
# Test local install
npm install -g ./lofetch-2.0.0.tgz
lofetch --version
npm uninstall -g lofetch
# Clean up
rm lofetch-2.0.0.tgz# Commit new files
git add package.json .npmignore Formula/ INSTALL.md PUBLISH.md test_package.sh Makefile README.md
git commit -m "feat: add npm and Homebrew installation support"
# Create and push tag
git tag -a v2.0.0 -m "Release v2.0.0"
git push origin main
git push origin v2.0.0
# Create release on GitHub
# Go to: https://github.com/jwuxan/lofetch/releases/new
# - Select tag: v2.0.0
# - Title: v2.0.0
# - Copy notes from CHANGELOG.mdAfter creating the GitHub release:
# Download release tarball
curl -L https://github.com/jwuxan/lofetch/archive/refs/tags/v2.0.0.tar.gz -o release.tar.gz
# Calculate SHA256
shasum -a 256 release.tar.gz
# Update Formula/lofetch.rb line 6 with the SHA256
# Then commit:
git add Formula/lofetch.rb
git commit -m "chore: update Homebrew formula SHA256"
git push origin main# Login to npm (if not already)
npm login
# Publish
npm publish
# Verify
npm view lofetch# Test npm
npm install -g lofetch
lofetch --version
npm uninstall -g lofetch
# Test npx
npx lofetch
# Test Homebrew
brew tap jwuxan/lofetch https://github.com/jwuxan/lofetch
brew install lofetch
lofetch --version
brew uninstall lofetchlofetch/
├── lofetch # Main script
├── package.json # ⭐ npm manifest
├── .npmignore # ⭐ npm exclusions
├── Formula/
│ └── lofetch.rb # ⭐ Homebrew formula
├── test_lofetch.sh # Main tests (110)
├── test_package.sh # ⭐ Package tests (16)
├── Makefile # ⭐ Updated with test-package
├── README.md # ⭐ Updated with install methods
├── INSTALL.md # ⭐ Installation guide
├── PUBLISH.md # ⭐ Publishing guide
└── INSTALLATION_SUMMARY.md # ⭐ This file
⭐ = New or updated for npm/Homebrew support
- npm global:
npm install -g lofetch - npx:
npx lofetch(no install needed) - Homebrew:
brew install lofetch - Git clone:
git clone ... && make install - curl:
curl ... | bash - Manual: Download and copy to PATH
- All tests pass successfully
- Version is consistent across all files (2.0.0)
- npm package name "lofetch" needs to be available (check with
npm view lofetch) - If unavailable, use scoped package:
@your-username/lofetch - Homebrew formula references GitHub releases (requires tags)
- The script is already executable and has --version support
- No changes to core lofetch functionality were needed
The implementation is complete and tested. Follow the "Next Steps to Publish" above to make lofetch available via npm and Homebrew.