{"_id":"@efanworks/mini-bundler","_rev":"8-7db3cbd2e20607f3863c372686289082","name":"@efanworks/mini-bundler","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@efanworks/mini-bundler","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.0","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"a2cd8eaaa5f6b1b4816501ea0cc06dd35bcc211e","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.0.tgz","fileCount":17,"integrity":"sha512-cii9Lv4iS0d+qygLoaNMJ6IMXQL7yM3P7mgFL0JgEP8ctb32W8zmbxHbMoVdSfwG8RpX4zsHy+DBpEPCfEP9bw==","signatures":[{"sig":"MEUCIG03dqhoDIuYADIcvcwZ1EmRfw6ELs/H+6CaI0IOmxOqAiEAyFrCncnsnzU7hbJ3+G6juYQ6WP4xYUq8h8oNJYTVfLM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12309},"main":"src/bundler.js","gitHead":"65d27b8cb2a16bd90604c240fe3e7c681a6f1133","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.0_1774418432894_0.4728529238325365","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@efanworks/mini-bundler","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.1","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"a6b8b0adf111b34497c7e020187aa7fc7c657355","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.1.tgz","fileCount":17,"integrity":"sha512-g9NBFeyybi3ZWL/QSt01/Z5x1oSxsb1aucJ8fcevDHQdcD3zRGEbY5uoveHkp/zESRpH/eG3YIK1XzwDxAlSbw==","signatures":[{"sig":"MEUCIQC030f5yJySz3Wr+2w6ZGca4FvSOTk2XBXx5IU/UYKXrgIgSURuOcjcuI3LNgkk2M4bZoPlZrQkJ+BVlroImKGc9ls=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12580},"main":"src/bundler.js","gitHead":"d25a4f08d966049e24745aadc53d1522bdcac069","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.1_1774430047762_0.4495410217331084","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@efanworks/mini-bundler","version":"1.0.2","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.2","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"ec0573874c2a1fa41bf6b1b9649c2d10ff1e1467","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.2.tgz","fileCount":17,"integrity":"sha512-HLESnw+2zm7w6Vj3wSPFfUGnfAn7nfLs6pCWSGMbLG5w+fIejPFnxnMjvr+uqXVJn0KVa+MUfLdPjCcjG8ag6A==","signatures":[{"sig":"MEUCIQChYK85xUIm08VEM5sLDYg0LMYhyNIUrA/Cv2p2CF128QIgG8KE1AtCqiXjxS0kKFHYTQb4u7FFlT5DBahFIIoAI7s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12580},"main":"src/bundler.js","gitHead":"d25a4f08d966049e24745aadc53d1522bdcac069","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.2_1774430090778_0.31966674176829746","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@efanworks/mini-bundler","version":"1.0.3","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.3","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"12807fb57ddc61848e2a84ac93a8d7e64bcba90d","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.3.tgz","fileCount":17,"integrity":"sha512-N3LLazWPt9aI69w54idaQ9Rwro68VEFvPzKj9SoNyDT8BLe+GpJNjjTeeTzCAGOh2PSOPSd7zuA36lqkvQf4mA==","signatures":[{"sig":"MEQCIAYRuhKZFO4I/7Av1anha0kp+UObQfsGLUWfvOTkGeqOAiBZky9oUlW9zEXRWwZWZKZdrErIMA1BIsLivIZir7oRmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12584},"main":"src/bundler.js","gitHead":"7a054c5c1f20e857ef7c7d7ceec53731333b34be","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.3_1774430897866_0.8820351225242586","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@efanworks/mini-bundler","version":"1.0.4","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.4","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"ff03610575f3a7e67fcc0846748f5e30505a5ed3","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.4.tgz","fileCount":17,"integrity":"sha512-bkIdTIB9fGA4F4KquLiOFaYkeyZ4rkHqUrN0vDYbEESpjXfKKuXHMI9JJmRd+sHNjHm7eGIJO6GgUO6rMR2vdw==","signatures":[{"sig":"MEQCIC6BupswcYUyqjWxcDskYzLfgEM+OUbBt6vpKCuiStbNAiAD8zl0gmetPDrz5HBzaI7SDvc+DU/KAq0OcrHIq7HhFQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12693},"main":"src/bundler.js","gitHead":"7a054c5c1f20e857ef7c7d7ceec53731333b34be","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.4_1774431028752_0.5672719797599879","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@efanworks/mini-bundler","version":"1.0.5","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.5","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"b587f79e7001a4a6844cfb818be1c7e8cadd1646","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.5.tgz","fileCount":17,"integrity":"sha512-kBfNNLTR/tR1qv9x1TVEEXuUElgzxmfdQ6iupRbs2Ay088rrCtMolEvhj8HggBkR/xm9ICQhxDwFFqqSdVMBKQ==","signatures":[{"sig":"MEUCIH4xk3bJ/SQPth0ySaRPd5XXrIQ9zztMpQAsqbP/F55XAiEAkMqXLZuuOT/WMo7aF3E67j/AjLpfez3wUqX0UQGYcJc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12584},"main":"src/bundler.js","gitHead":"7a054c5c1f20e857ef7c7d7ceec53731333b34be","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.5_1774431552741_0.334083122520098","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@efanworks/mini-bundler","version":"1.0.6","keywords":[],"author":"","license":"ISC","_id":"@efanworks/mini-bundler@1.0.6","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"bin":{"greeting":"bin/greeting.js","mini-bundler":"bin/mini-bundler.js"},"dist":{"shasum":"96fc6004ab3e2aa33e34215a9b7c1e4c933e45d6","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.6.tgz","fileCount":17,"integrity":"sha512-zMJRH4gWiULZjcVnHQeKqQrAuIDaBCrDa3aMTOW9Z95ZwLGq2kvx7wFNtWwXo7/K+BXi+QDwmLSzvktPHlMqLA==","signatures":[{"sig":"MEUCIQCb1Fvz84SrZsRwcTe8OG3xxzLwjDMticQkSLYFsVLZ4wIgbOMXa/GtzpXJo/M75tV/1pLKZ/bveeCknSmaNy5ACsE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12386},"main":"src/bundler.js","gitHead":"7a054c5c1f20e857ef7c7d7ceec53731333b34be","scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"_npmVersion":"10.9.4","description":"A minimal CommonJS require bundler","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^14.0.3","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","@babel/generator":"^7.29.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mini-bundler_1.0.6_1774432161091_0.8597867728088182","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@efanworks/mini-bundler","version":"1.0.7","description":"A minimal CommonJS require bundler","main":"src/bundler.js","bin":{"mini-bundler":"bin/mini-bundler.js","greeting":"bin/greeting.js"},"scripts":{"build:example":"node ./bin/mini-bundler.js build examples/src/index.js -o examples/dist/bundle.js"},"keywords":[],"author":"","license":"ISC","dependencies":{"@babel/generator":"^7.29.1","@babel/parser":"^7.29.2","@babel/traverse":"^7.29.0","commander":"^14.0.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@efanworks/mini-bundler@1.0.7","gitHead":"7a054c5c1f20e857ef7c7d7ceec53731333b34be","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-N/qBGmxXZJvSnDagfyGFwVtQPmdksAixafzgQzWh3vMsgNJt7sfzneIKXsZClxAeSB6XEhZ45B0X507OTX+w0A==","shasum":"e3414d12a123ff8fa5d70c782224437cb15176ee","tarball":"https://registry.npmjs.org/@efanworks/mini-bundler/-/mini-bundler-1.0.7.tgz","fileCount":17,"unpackedSize":12661,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHxGv3DyDhtVvagpUlt7sds4nKsRS32qeqTcgzWTx7R/AiBkpIx9Wf58BzpLQWnZFsurIVW+sFADAf1c64iVyc35XA=="}]},"_npmUser":{"name":"efanworks","email":"eafanzhuo@gmail.com"},"directories":{},"maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mini-bundler_1.0.7_1774433470092_0.07056133886007987"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T06:00:32.785Z","modified":"2026-03-25T10:11:10.379Z","1.0.0":"2026-03-25T06:00:33.029Z","1.0.1":"2026-03-25T09:14:07.907Z","1.0.2":"2026-03-25T09:14:55.930Z","1.0.3":"2026-03-25T09:28:18.018Z","1.0.4":"2026-03-25T09:30:28.974Z","1.0.5":"2026-03-25T09:39:12.871Z","1.0.6":"2026-03-25T09:49:21.244Z","1.0.7":"2026-03-25T10:11:10.239Z"},"license":"ISC","keywords":[],"description":"A minimal CommonJS require bundler","maintainers":[{"name":"efanworks","email":"eafanzhuo@gmail.com"}],"readme":"## mini-bundler\n\n`mini-bundler` 是一个极简 JavaScript 打包工具，专注于 CommonJS 场景。  \n它把多个模块（`require` / `module.exports`）打包为一个可直接执行的 bundle，并内置最小运行时（`__my_require__` + 模块缓存）。\n\n## 技术栈\n\n- Node.js：文件读取、路径处理、CLI 执行环境\n- Babel AST 工具链：\n  - `@babel/parser`：将源码解析为 AST\n  - `@babel/traverse`：收集依赖、遍历语法树\n  - `@babel/generator`：将转换后的 AST 生成代码\n- `commander`：实现命令行参数解析与命令入口\n\n## 这个项目解决了什么问题\n\n- 把分散的 CommonJS 模块合并成单文件，方便运行与分发\n- 在浏览器侧模拟 Node 的 `require` 行为（模块查找、执行、导出）\n- 通过模块缓存避免重复执行，并支持循环依赖的基础处理\n- 以最小实现展示 bundler 核心原理，便于学习 webpack/runtime 思路\n\n## 核心流程\n\n1. 从入口文件开始解析源码\n2. 扫描 `require(...)` 构建依赖图\n3. 转换模块代码并生成模块工厂函数\n4. 注入运行时模板（`require` + `cache`）\n5. 输出最终 bundle 文件\n\n## 安装依赖\n\n```bash\nnpm install\n```\n\n## 打包示例项目\n\n```bash\nnpm run build:example\n```\n","readmeFilename":"README.md"}