{"_id":"2dev","_rev":"4-3774057ea1ecd6a2dbacf8e37a44c7c7","name":"2dev","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"2dev","version":"0.1.0","keywords":["terminal","directory","file-listing","web","cli"],"author":"","license":"MIT","_id":"2dev@0.1.0","maintainers":[{"name":"zsio","email":"zsio@qq.com"}],"bin":{"2dev":"bin/cli.js"},"dist":{"shasum":"f41d9b8a51350c6cea18da36393c9169229dc5cb","tarball":"https://registry.npmjs.org/2dev/-/2dev-0.1.0.tgz","fileCount":7,"integrity":"sha512-8Rk1EOfzMJV76kyQqeW8JJI9EW0JFi29OT3WSdWkQFQ0kV0De3b5Ky0SvWB4VRPjkSkBkqaLoFC9zw67bHQiuw==","signatures":[{"sig":"MEUCIQD859wGG7sO15u76Ku/iycF8al9BXIeEJcN4rTL112jvwIgM80AqCBlDvoK4JCIDhv8hsve0m106a2iVaX1EdOjaFQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8339},"type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"pnpm --filter backend dev & pnpm --filter frontend dev","build":"pnpm build:all","start":"node bin/cli.js","build:all":"pnpm --filter frontend build && pnpm --filter backend build","dev:backend":"pnpm --filter backend dev","dev:frontend":"pnpm --filter frontend dev","build:backend":"pnpm --filter backend build","build:frontend":"pnpm --filter frontend build","prepublishOnly":"pnpm build"},"_npmUser":{"name":"zsio","email":"zsio@qq.com"},"_npmVersion":"11.6.1","description":"A simple web-based directory listing tool - example usage of remote terminal","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/2dev_0.1.0_1759280636440_0.1593757577634618","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"2dev","version":"0.1.1","keywords":["terminal","directory","file-listing","web","cli"],"author":"","license":"MIT","_id":"2dev@0.1.1","maintainers":[{"name":"zsio","email":"zsio@qq.com"}],"bin":{"2dev":"bin/cli.js"},"dist":{"shasum":"888c3ed03acdc7a8158b00bb4b34eb03ac63d62b","tarball":"https://registry.npmjs.org/2dev/-/2dev-0.1.1.tgz","fileCount":7,"integrity":"sha512-camw2jubaoUznImUMxF+97Xqc8XkNOyQPed6Ebxq9RtnWXhfGbqmfr1OK7RR//Jeqf8fPAQlyS1KY0J7zrXLRA==","signatures":[{"sig":"MEUCIQDpcswe4Gy0B7/THnSRZofUPlaE+iwUBvPvWM7K3vyaMgIgNtAUS6X+JziUg1QY4SoX6e+HN0+5LakUxej/AX6RCxg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8339},"type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"pnpm --filter backend dev & pnpm --filter frontend dev","build":"pnpm build:all","start":"node bin/cli.js","build:all":"pnpm --filter frontend build && pnpm --filter backend build","dev:backend":"pnpm --filter backend dev","dev:frontend":"pnpm --filter frontend dev","build:backend":"pnpm --filter backend build","build:frontend":"pnpm --filter frontend build","prepublishOnly":"pnpm build"},"_npmUser":{"name":"zsio","email":"zsio@qq.com"},"_npmVersion":"11.6.1","description":"A simple web-based directory listing tool - example usage of remote terminal","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/2dev_0.1.1_1759280698490_0.7744557512561625","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"2dev","version":"0.1.2","keywords":["terminal","directory","file-listing","web","cli"],"author":"","license":"MIT","_id":"2dev@0.1.2","maintainers":[{"name":"zsio","email":"zsio@qq.com"}],"bin":{"2dev":"bin/cli.js"},"dist":{"shasum":"8e7761b744cefe793bb7f2e53464607b545fd709","tarball":"https://registry.npmjs.org/2dev/-/2dev-0.1.2.tgz","fileCount":14,"integrity":"sha512-JN0dyHoSQ5AgOeCq1EiRldITwvbV0xJopY430BJO3B5YHytJWtzoBJmRmpdzIg2ggB35msKWsBSGZhNzGvuuOA==","signatures":[{"sig":"MEQCIHIf3OWoJCfEi2Gmdd6n7LmWF0pOATSCptdk6fiIJuoCAiASnYIwMC5y9eqZyw39WlIaBrmOGs2/0xZJfcIfqCzIXg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":200511},"type":"module","engines":{"node":">=18.0.0"},"scripts":{"dev":"pnpm --filter backend dev & pnpm --filter frontend dev","build":"pnpm build:all","start":"node bin/cli.js","build:all":"pnpm --filter frontend build && pnpm --filter backend build","dev:backend":"pnpm --filter backend dev","dev:frontend":"pnpm --filter frontend dev","build:backend":"pnpm --filter backend build","build:frontend":"pnpm --filter frontend build","prepublishOnly":"pnpm build"},"_npmUser":{"name":"zsio","email":"zsio@qq.com"},"_npmVersion":"11.6.1","description":"A simple web-based directory listing tool - example usage of remote terminal","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/2dev_0.1.2_1759280837974_0.5955449911428603","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"2dev","version":"0.1.3","description":"A simple web-based directory listing tool - example usage of remote terminal","type":"module","bin":{"2dev":"bin/cli.js"},"scripts":{"dev":"pnpm --filter backend dev & pnpm --filter frontend dev","dev:frontend":"pnpm --filter frontend dev","dev:backend":"pnpm --filter backend dev","build":"pnpm build:all","build:all":"pnpm --filter frontend build && pnpm --filter backend build","build:frontend":"pnpm --filter frontend build","build:backend":"pnpm --filter backend build","start":"node bin/cli.js","prepublishOnly":"pnpm build"},"dependencies":{"@koa/cors":"^5.0.0","@koa/router":"^14.0.0","koa":"^3.0.1","koa-bodyparser":"^4.4.1","koa-static":"^5.0.0"},"keywords":["terminal","directory","file-listing","web","cli"],"author":"","license":"MIT","engines":{"node":">=18.0.0"},"_id":"2dev@0.1.3","_nodeVersion":"22.14.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-+cQ5Ndia5FoWHysBOcaCDWbOiuT6XicispvCDisyIc5ZmhDvSs1+No9oULxxnqVEVWowyD+eLQcGFd1aVt5x9A==","shasum":"20e3c113a3b2648e709f1265966268f64d075869","tarball":"https://registry.npmjs.org/2dev/-/2dev-0.1.3.tgz","fileCount":14,"unpackedSize":200673,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDv31+Is5YArHbhEvm/8xVNNkdGn+4qaJljZ6FaYOVRtgIgZZ1W8evB7eH8fUORL38oq3v4YwFxV9c5IHqOE79Ysoo="}]},"_npmUser":{"name":"zsio","email":"zsio@qq.com"},"directories":{},"maintainers":[{"name":"zsio","email":"zsio@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/2dev_0.1.3_1759281364314_0.8796981184796961"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-01T01:03:56.438Z","modified":"2025-10-01T01:16:04.695Z","0.1.0":"2025-10-01T01:03:56.631Z","0.1.1":"2025-10-01T01:04:58.704Z","0.1.2":"2025-10-01T01:07:18.242Z","0.1.3":"2025-10-01T01:16:04.510Z"},"license":"MIT","keywords":["terminal","directory","file-listing","web","cli"],"description":"A simple web-based directory listing tool - example usage of remote terminal","maintainers":[{"name":"zsio","email":"zsio@qq.com"}],"readme":"# 2dev\n\n一个简单的基于Web的目录查看工具，展示如何使用 pnpm workspace + Koa + React 构建可通过 npx 使用的CLI工具。\n\n## 功能\n\n- 📁 显示当前目录的文件列表（排除隐藏文件）\n- 🌐 Web界面展示\n- 📦 可通过 npx 直接使用\n\n## 快速开始\n\n### 使用 npx（发布到npm后）\n\n```bash\nnpx 2dev\n```\n\n然后访问 http://localhost:3000\n\n### 全局安装\n\n```bash\nnpm install -g 2dev\n# 或\npnpm install -g 2dev\n\n# 使用\n2dev\n```\n\n## 开发\n\n### 安装依赖\n\n```bash\npnpm install\n```\n\n### 开发模式\n\n开发模式下，前端和后端分别运行：\n\n- 前端：Vite开发服务器（默认端口5173）\n- 后端：Koa API服务器（默认端口3000）\n- 前端通过proxy访问后端API\n\n```bash\n# 同时启动前后端\npnpm dev\n\n# 或分别启动\npnpm dev:frontend\npnpm dev:backend\n```\n\n### 构建\n\n```bash\npnpm build\n```\n\n### 本地测试\n\n```bash\n# 构建并启动生产环境\npnpm build\npnpm start\n```\n\n访问 http://localhost:3000\n\n## 发布到 npm\n\n1. **登录 npm**\n   ```bash\n   npm login\n   ```\n\n2. **修改包名**（如果 `2dev` 已被占用）\n   编辑 `package.json`，修改 `name` 字段为可用的包名。\n\n3. **发布**\n   ```bash\n   npm publish\n   ```\n\n   注意：发布时会自动执行 `prepublishOnly` 脚本构建项目。\n\n4. **测试发布的包**\n   ```bash\n   npx your-package-name\n   ```\n\n## 项目结构\n\n```\n2dev/\n├── packages/\n│   ├── frontend/          # React + Vite前端\n│   └── backend/           # Koa2后端API\n├── bin/\n│   └── cli.js            # CLI入口文件\n├── pnpm-workspace.yaml   # pnpm workspace配置\n└── package.json          # 根package.json（CLI配置）\n```\n\n## 技术栈\n\n- **前端**: React 19 + Vite 7 + TypeScript\n- **后端**: Koa 3 + @koa/router + TypeScript\n- **包管理**: pnpm workspace\n- **构建工具**: Vite (前端) + tsc (后端)\n\n## 环境说明\n\n- **开发环境**: 前后端独立运行，前端通过proxy访问后端\n- **生产环境**: 后端托管前端dist静态资源，单一服务端口\n\n## API接口\n\n- `GET /api/health` - 健康检查\n- `GET /api/files` - 获取当前目录文件列表（排除隐藏文件）\n\n## License\n\nMIT\n","readmeFilename":"README.md"}