New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

hookcn

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hookcn

A CLI tool that instantly copies React hooks into your codebase

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

hookcn — All your hooks in one command

A CLI tool that instantly copies React hooks into your codebase.

npm version downloads license


Cover Image

hookcn started as a personal tool. Now it’s open for everyone. It lets you copy TypeScript React hooks directly into your codebase — no dependencies, full ownership.


🛠 Getting Started

Install the CLI globally:

npm install -g hookcn

[!TIP] You can then run commands using hookcn, hcn, or use-hook-cli.

⚙️ Setup

Step 1: Initialize the Config

npx hookcn init

This creates a hooks.json file at your project root:

{
  "destination": "src/hooks"
}

This tells the CLI where to place downloaded hooks. You can update it anytime.

Step 2: Add a Hook

List available hooks from the registry:

npx hookcn list

Install a hook by name:

npx hookcn add <hook-name>

The hook will be copied into the directory defined in hooks.json (default: src/hooks/).


📚 Documentation

Every hook comes with a markdown file inside the docs/ folder.

You can also explore all available hooks and their documentation online on Gitbook.

🤝 Contributing

Contributions are always welcome — whether it’s new hooks, CLI improvements, or documentation fixes.

Refer to this guide CONTRIBUTING.md for more details.

Keywords

react

FAQs

Package last updated on 23 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts