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 🙏

© 2026 – Pkg Stats / Ryan Hefner

yadamzer-comment-tools

v1.0.0

Published

CLI tool to hide and unhide developer comments in React + TypeScript projects

Readme

Yadamzer Comment Tools

A CLI tool to hide and unhide developer comments in React + TypeScript projects. Perfect for keeping code clean for production/demo while preserving full comment documentation for recruiters and future developers.

Features

  • 🔒 Hide Comments: Replace tagged comments with unique identifiers
  • 🔓 Unhide Comments: Restore original comments from cache
  • 📋 Status Check: View all hidden comments and their locations
  • 🎯 Line-specific Operations: Target specific lines or comment IDs
  • 💾 Persistent Cache: Store original comments in .comment-cache.json
  • 📝 Multi-line Comments: Hide entire comment blocks that start with @dev: or @hideable:

Installation

Global Installation (Recommended)

npm install -g yadamzer-comment-tools

Local Installation

npm install --save-dev yadamzer-comment-tools

Quick Start

# Hide all tagged comments in a file
comment-tools hide src/components/MyComponent.tsx

# Unhide all hidden comments
comment-tools unhide src/components/MyComponent.tsx

# Check status of hidden comments
comment-tools status

Supported Comment Tags

The tool recognizes comments tagged with:

  • // @dev: Your comment here
  • // @hideable: Your comment here

Multi-line Comment Support

The tool can hide entire comment blocks that start with @dev: or @hideable:. It will continue hiding subsequent comment lines until it encounters a non-comment line.

Supported comment line formats:

  • // - Single-line comments
  • /* - Block comment start
  • */ - Block comment end
  • * - Block comment continuation

Example:

// @dev: This is a multi-line comment block
// that spans multiple lines
// and includes various comment formats
/*
 * This is a block comment
 * that continues the multi-line comment
 */
// This line is also part of the comment block
// until we reach the function declaration

function MyComponent() {
  // This function will be visible
}

Usage

Hide Comments

# Hide all tagged comments in a file
comment-tools hide src/components/Editor/Canvas.tsx

# Hide specific comment by line number
comment-tools hide src/components/Editor/Canvas.tsx --line 42

Unhide Comments

# Unhide all hidden comments in a file
comment-tools unhide src/components/Editor/Canvas.tsx

# Unhide specific comment by line number
comment-tools unhide src/components/Editor/Canvas.tsx --line 42

# Unhide specific comment by ID
comment-tools unhide src/components/Editor/Canvas.tsx --id yct:abc123

Check Status

# Show all hidden comments
comment-tools status

# Show hidden comments for specific file
comment-tools status src/components/Editor/Canvas.tsx

How It Works

Hide Process

  1. Scans file for comments tagged with @dev: or @hideable:
  2. For multi-line comments: continues until non-comment line is found
  3. Generates unique ID (e.g., yct:abc123)
  4. Replaces comment block with: // [comment hidden - yct:abc123]
  5. Stores original comment in .comment-cache.json

Unhide Process

  1. Scans file for hidden markers: // [comment hidden - yct:abc123]
  2. Looks up original comment in cache
  3. Replaces marker with original comment (restores multi-line structure)
  4. Removes entry from cache

Cache File Structure

{
  "src/components/Editor/Canvas.tsx": {
    "yct:df129e": "// @dev: Drag logic for shapes",
    "yct:a8b34f": "// @hideable: Element resize setup",
    "yct:multi123": "// @dev: Multi-line comment\n// Second line\n// Third line"
  }
}

Development

Build

npm run build

Development Mode

npm run dev

Test with Sample Files

# Build the project
npm run build

# Test hiding comments
node dist/index.js hide sample-component.tsx
node dist/index.js hide test-multiline.tsx

# Test unhiding comments
node dist/index.js unhide sample-component.tsx
node dist/index.js unhide test-multiline.tsx

# Check status
node dist/index.js status

Example

Before hiding:

// @dev: This component handles the main canvas functionality
// with multi-line support
// and various comment formats
/*
 * Block comments are also supported
 */
function Canvas() {
  // @hideable: Initialize canvas context
  // and set up event listeners
  useEffect(() => {
    // ... code
  }, []);
}

After hiding:

// [comment hidden - yct:abc123]
function Canvas() {
  // [comment hidden - yct:def456]
  useEffect(() => {
    // ... code
  }, []);
}

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

License

MIT

Support

If you find this tool helpful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting bugs
  • 💡 Suggesting new features
  • �� Contributing code