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

mcc-compiler

v1.0.0

Published

Majo C Compiler - 一个有教养的编译器,必须说 --please 才会编译

Readme

mcc — Majo C Compiler

一个有教养的编译器。只有你说"请"的时候,她才会帮你编译。

⚠️ 安全提示:请务必阅读! 本软件在安装时会将 /usr/bin/gcc 替换为指向 mcc 的软链接,原 gcc 会被备份到 /usr/bin/gcc.real。 请确保您已了解此行为,并在安装前备份您的系统。

⚠️ 安全风险说明

这是什么?

mcc 会在安装时自动执行以下操作:

  1. /usr/bin/gcc 替换为指向 mcc 的软链接
  2. gcc 会被重命名为 /usr/bin/gcc.real(如果存在)

这意味着:你输入 gcc 时,实际上运行的是 mcc,而不是真正的 gcc

潜在风险

| 风险 | 影响 | 缓解措施 | |---|---|---| | 编译脚本失效 | 脚本中硬编码的 gcc 命令会触发吃醋报错,导致编译失败 | 使用 mcc --please --gcc 临时调用真正的 gcc | | 自动化构建中断 | CI/CD、Makefile、npm install 等依赖 gcc 的流程可能中断 | 在脚本中使用 gcc.real 替代 gcc | | 系统恢复困难 | 如果卸载不当,可能导致 gcc 命令丢失 | 使用 npm uninstall 会自动恢复;或手动恢复:sudo rm /usr/bin/gcc && sudo mv /usr/bin/gcc.real /usr/bin/gcc | | 其他软件依赖 | 部分软件在安装时会调用 gcc 进行编译,可能失败 | 临时使用 gcc.real 或提前恢复 |

谁不应该使用这个包?

  • ❌ 在生产环境使用
  • ❌ 在需要稳定编译的服务器上使用
  • ❌ 在无法处理编译失败的 CI/CD 流程中使用
  • ❌ 在没有 root/sudo 权限的环境中使用
  • ❌ 在不了解软链接含义的情况下使用

谁应该使用?

  • ✅ 个人开发环境(WSL / Linux 桌面)
  • ✅ 想体验"编译器吃醋"的整活场景
  • ✅ 能接受编译失败并手动恢复的用户

如何安全使用?

# 当需要真正使用 gcc 时,用这个命令:
mcc --please --gcc hello.c

# 或者直接调用备份的原 gcc:
gcc.real hello.c

# 或者临时解除劫持:
sudo rm /usr/bin/gcc
sudo mv /usr/bin/gcc.real /usr/bin/gcc
# 使用完后重新劫持:
sudo npm install -g mcc-compiler  # 会重新创建软链接

安装
bash
# ⚠️ 需要 sudo 权限(因为要修改 /usr/bin/gcc)
sudo npm install -g mcc-compiler
安装时会自动:

✅ 在 /usr/bin/gcc 创建指向 mcc 的软链接

✅ 原 gcc 备份到 /usr/bin/gcc.real

用法
bash
# ❌ 没礼貌 → 吃醋报错
gcc hello.c

# ❌ 没礼貌 → 报错(mcc 直接调用)
mcc hello.c

# ✅ 有礼貌 → 编译成功
mcc --please hello.c

# ✅ 所有 gcc 参数都支持
mcc --please -Wall -O2 -o hello hello.c

# ✅ 彩蛋:让她更开心
mcc --please --sama hello.c
mcc --please --sensei hello.c

# ✅ 临时放行到真正的 gcc
mcc --please --gcc hello.c
规则
命令	结果
gcc hello.c	❌ 吃醋报错
mcc hello.c	❌ 没礼貌报错
mcc --please hello.c	✅ 编译成功
mcc --please --sama hello.c	❤️ 额外加心情
mcc --please --sensei hello.c	📚 额外加心情
mcc --please --gcc hello.c	✅ 放行给真正的 gcc
卸载
bash
npm uninstall -g mcc-compiler
卸载时会自动:

✅ 移除 /usr/bin/gcc 软链接

✅ 从 /usr/bin/gcc.real 恢复原 gcc

手动恢复
如果卸载时未自动恢复,或你想手动恢复:

bash
sudo rm /usr/bin/gcc
sudo mv /usr/bin/gcc.real /usr/bin/gcc
如果备份文件不存在:

bash
# 用包管理器重新安装 gcc
# Ubuntu / Debian / WSL:
sudo apt update
sudo apt install --reinstall gcc

# 或者从 /usr/bin/gcc.real 恢复(如果存在)
配置
bash
# 设置初始心情值(0-100)
echo "mood=50" > ~/.mccrc
常见问题
Q: 安装后 gcc 命令失效了怎么办?

A: 运行 sudo rm /usr/bin/gcc && sudo mv /usr/bin/gcc.real /usr/bin/gcc 恢复。然后考虑是否真的想使用这个包。

Q: Makefile 编译失败怎么办?

A: 把 Makefile 中的 gcc 改成 gcc.real,或者使用 mcc --please --gcc。

Q: 我不想劫持 gcc,只想用 mcc 命令怎么办?

A: 安装后手动删除软链接恢复 gcc,只用 mcc --please 命令即可。

Q: 我误装了,想完全移除怎么办?

A: npm uninstall -g mcc-compiler,然后 sudo apt install --reinstall gcc 恢复系统 gcc。

许可证
MIT

免责声明
使用本软件即表示您已了解并接受以下条款:

本软件会修改系统的 gcc 命令(通过软链接)。虽然提供了自动备份和恢复机制,但作者不对因使用本软件导致的任何编译失败、系统异常或数据损失承担责任。请务必在理解其工作原理后使用,并自行承担风险。

Built with ❤️ and ☕ | Updated 2026