npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

codereg

v1.4.0

Published

A CLI tool for copying and managing source code directly from GitHub repositories, perfect for modern React UI libraries and custom code management.

Readme

CodeReg

A powerful command-line tool for copying and managing source code directly from GitHub repositories. Instead of installing libraries as dependencies, CodeReg allows you to copy specific source code files into your project, giving you full control over the code and making it easier to customize.

Key Features

  • Copy source code directly from GitHub repositories instead of installing packages
  • Perfect for modern React UI libraries that share source code rather than bundled packages
  • Interactive GUI-like CLI interface for easy code registration
  • Registry-based configuration system for managing multiple code sources
  • Support for copying any public files from GitHub repositories
  • Easy customization of copied code since it's directly in your project
  • Branch and path-specific code copying
  • Progress indicators and interactive prompts

Why CodeReg?

In modern web development, especially with React UI libraries, there's a growing trend of sharing source code instead of bundled packages. This approach offers several advantages:

  • Full control over the code in your project
  • Easy customization and modification
  • No need to deal with complex bundling configurations
  • Direct access to source code for debugging and learning
  • Ability to modify and adapt code to your specific needs

CodeReg makes this workflow seamless by providing a simple way to copy and manage source code from GitHub repositories.

Installation

Global Installation

You can install CodeReg globally using pnpm:

pnpm add -g codereg

Local Project Installation

To install CodeReg as a development dependency in your project:

pnpm add -D codereg

After local installation, you can use it in your project's scripts in package.json:

{
  "scripts": {
    "register": "codereg"
  }
}

Then run it using:

pnpm register

Or use it directly with npx:

npx codereg

Usage

Basic Commands

Initialize Project

Initialize a new CodeReg project in your current directory:

npx codereg init

This will create a default configuration file .codereg.config.json in your project root.

Example configuration:

{
  "$schema": "https://cdn.jsdelivr.net/npm/codereg/dist/config.schema.json",
  "registry": [
    {
      "name": "ui", // name your entry
      "url": "https://github.com/xxx/ui",
      "branch": "main", // optional
      "path": "/packages/ui/src", // optional
      "dirname": "./components"
    }
  ]
}

Add Registration

Add a new code registration using the interactive CLI:

codereg add

The interactive prompt will guide you through:

  • Selecting the registry
  • Choosing the branch
  • Specifying the source path
  • Selecting files to copy
  • Setting the destination directory

Command Options

Add Command with options

codereg add -r ui -b main -p /packages/ui/src -f button.tsx

Common Flags

  • -r, --registry: Specify the registry name to add (e.g., 'ui')
  • -b, --branch: Specify the branch name (e.g., 'main')
  • -p, --path: Specify the source path in the registry (e.g., '/packages/ui/src')
  • -f, --file: Specify the file to register (e.g., 'button.tsx')
  • --help or -h: Show help information
  • --version or -V: Show version information

Use Cases

React UI Libraries

CodeReg is particularly useful for modern React UI libraries that share source code. Instead of installing the entire package, you can copy only the components you need and customize them directly in your project.

Custom Code Management

  • Copy utility functions from public repositories
  • Share code between projects
  • Maintain a local registry of commonly used code snippets
  • Version control your custom code modifications

Learning and Experimentation

  • Study and learn from open-source code
  • Experiment with different implementations
  • Create your own modified versions of existing code

Development

Prerequisites

  • Node.js (Latest LTS version recommended)
  • pnpm

Setup

  1. Clone the repository:
git clone https://github.com/onepercman/codereg.git
cd codereg
  1. Install dependencies:
pnpm install

Available Scripts

  • pnpm build - Build the project
  • pnpm dev - Start development mode with watch
  • pnpm start - Run the built project
  • pnpm test - Run tests

Building

To build the project:

pnpm build

This will create the distribution files in the dist directory.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Author

  • onepercman

Support

If you encounter any issues or have questions, please open an issue on GitHub.