open-hook
v1.0.6
Published
π¦ A developer-friendly CLI to install and manage reusable πͺ React custom hooks directly from a centralized GitHub repository. Supports βοΈ configuration, π₯ hook installation, π listing with metadata, and works with both TypeScript and JavaScript.
Downloads
14
Readme
open-hook π£
A CLI tool to manage and install reusable React custom hooks from a centralized repository
Supercharge your React development with community-vetted hooks!
π Quick Start
Installation
npm install -g open-hook
# or
pnpm add -g open-hookBasic Usage
# Initialize your project
npx open-hook init
# Browse and add hooks interactively
npx open-hook add
# Or add specific hooks
npx open-hook add useFetch useLocalStorage --language tsπ Fun Break
π‘ open-hook pro tip:
"Why did the React dev bring a fishing rod to work?"
Because they heard there were custom hooks to catch! π£
β¨ Features
| Feature | Description | |---------|-------------| | π¦ Hook Management | Install, update, and manage hooks effortlessly | | βοΈ Configurable | Customize installation directory and language | | π Conflict Resolution | Smart prompts when hooks exist | | π Manifest Support | Structured hook repository format | | π GitHub Integration | Directly fetches from raw GitHub URLs | | π» CLI Interface | Intuitive command-line experience |
π Detailed Usage
init Command
Initialize your project configuration:
npx open-hook initCreates open-hooks.config.json with:
- Default hooks directory (e.g.
src/hooks) - Preferred language (TypeScript/JavaScript)
- Repository URL
add Command
Install hooks with options:
# Interactive mode
npx open-hook add
# Direct installation
npx open-hook add ClickOutside LocalStorage --language ts
# Custom directory
npx open-hook add useDebounce --dir src/utils/hooksConflict Handling:
π Replace existing | βοΈ Skip hook | β Cancel all
list Command
View available hooks:
npx open-hook listDisplays a formatted table with:
- Hook names
- Available versions (JS/TS)
- Brief descriptions
βοΈ Configuration
Example open-hooks.config.json:
{
"hooksDir": "src/hooks",
"defaultLanguage": "ts",
"repoUrl": "https://github.com/****/OpenHooks"
}π οΈ Development Roadmap
Planned Features
- π Custom repository support via
--repoflag - π¦ Automatic dependency installation
- π Hook preview before download
- π Search functionality for hooks
- π·οΈ Version management for hooks
π€ Contributing
We welcome contributions! Here's how:
- Fork the repository
- Create your feature branch
- Submit a pull request
Hook Submission Guidelines:
- Include both JS and TS versions
- Add proper TypeScript types
- Include usage examples
- Document dependencies
π License
MIT Β© Rajeshkumar S & Vigneshwar
Enjoying open-hook?
Give us a β on GitHub and share with your team!
