{"_rev":"39-a335e101e19c0a38dde6a70887a6d714","time":{"created":"2026-03-16T01:28:55.791Z","modified":"2026-03-16T01:28:56.240Z","1.0.0":"2026-01-21T03:40:16.164Z","1.0.1":"2026-01-21T06:21:59.702Z","1.0.2":"2026-01-21T06:32:26.412Z","1.0.3":"2026-01-21T06:37:01.305Z","1.0.4":"2026-01-21T06:44:26.026Z","1.0.5":"2026-01-21T07:05:52.556Z","1.0.6":"2026-01-21T07:20:50.972Z","1.0.7":"2026-01-21T07:48:01.041Z","1.0.8":"2026-01-21T08:22:45.901Z","1.0.9":"2026-01-21T09:23:13.084Z","1.0.10":"2026-01-23T01:30:18.953Z","1.0.11":"2026-01-23T01:38:19.457Z","1.0.12":"2026-01-23T01:59:09.717Z","1.0.13":"2026-01-23T05:20:26.061Z","1.1.0":"2026-01-26T03:19:03.071Z","1.1.1":"2026-01-26T03:58:03.320Z","1.1.2":"2026-03-11T07:52:05.233Z","1.1.3":"2026-03-12T07:37:28.750Z","1.1.5":"2026-03-16T01:28:56.024Z"},"_id":"@heathenjs/taro-router","name":"@heathenjs/taro-router","dist-tags":{"latest":"1.1.5"},"versions":{"1.1.5":{"name":"@heathenjs/taro-router","version":"1.1.5","description":"Taro小程序路由库","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["taro","router","react","miniprogram"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"author":{"name":"heathen1998"},"license":"MIT","peerDependencies":{"@tarojs/taro":"^3.6.35","react":"^18.0.0"},"scripts":{"prod":"tsc -p ./tsconfig.json","clean":"rimraf dist","build":"pnpm run clean && pnpm run prod","tsc":"tsc -p ./tsconfig.json --noEmit","lint":"eslint --ext .ts  --max-warnings 0 \"./src\" "},"_id":"@heathenjs/taro-router@1.1.5","_integrity":"sha512-M3pHJWwP5FrDmW1ZgSGX/p/hGAX8kfS5QV2lka+6yp/FJs07ooB5Qkk0sp8zMMzZQLfxjaBgLKQ9KjCX5AmX4w==","_resolved":"/private/var/folders/78/dvwmjhd96vq29h7w9pk0wxs40000gp/T/15c10dd61347be682ec200e4ab5ead10/heathenjs-taro-router-1.1.5.tgz","_from":"file:heathenjs-taro-router-1.1.5.tgz","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-M3pHJWwP5FrDmW1ZgSGX/p/hGAX8kfS5QV2lka+6yp/FJs07ooB5Qkk0sp8zMMzZQLfxjaBgLKQ9KjCX5AmX4w==","shasum":"04cb07506e8fdcdd0639be995a08c97bb3b3f4be","tarball":"https://registry.npmjs.org/@heathenjs/taro-router/-/taro-router-1.1.5.tgz","fileCount":67,"unpackedSize":56200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD5IxrkO+S1e7vDYsxHJtdzivRjve4TcncJXONipmnX+AIhAKRe+MGSy15Mhjc0hHi0z8w6/FpqTMGUI8JvYsyfPpog"}]},"_npmUser":{"name":"heathen1998","email":"heathenjs@163.com"},"directories":{},"maintainers":[{"name":"heathen1998","email":"heathenjs@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/taro-router_1.1.5_1773624535875_0.9019080744733234"},"_hasShrinkwrap":false}},"maintainers":[{"name":"heathen1998","email":"heathenjs@163.com"}],"description":"Taro小程序路由库","keywords":["taro","router","react","miniprogram"],"author":{"name":"heathen1998"},"license":"MIT","readme":"# @heathenjs/taro-router\n\n[![](https://img.shields.io/npm/v/%40heathenjs%2Ftaro-router)](https://www.npmjs.com/package/@heathenjs/taro-router)\n[![](https://img.shields.io/npm/dm/%40heathenjs%2Ftaro-router)](https://www.npmjs.com/package/@heathenjs/taro-router)\n\nTaro小程序路由库\n\n## 特性\n<ol>\n<li>Promise 跳转，便于管理多页面的业务流程</li>\n<li>支持任意类型、任意大小的跳转参数</li>\n<li>路由中间件能力</li>\n</ol>\n\n## 安装\n强烈建议与配套的 [@heathenjs/taro-router-plugin](https://www.npmjs.com/package/@heathenjs/taro-router-plugin) 一同安装，享受路由自动生成、跳转参数类型校验等能力带来的开发体验\n#### pnpm\n```bash\npnpm add @heathenjs/taro-router-plugin --save-dev\npnpm add @heathenjs/taro-router\n```\n\n#### yarn\n```bash\nyarn add @heathenjs/taro-router-plugin --dev\nyarn add @heathenjs/taro-router\n```\n\n#### npm\n```bash\nnpm install @heathenjs/taro-router-plugin --save-dev\nnpm install @heathenjs/taro-router --save\n```\n\n### 解决了什么问题？\n#### 小程序进行路由跳转时，手写的 url 无法确认链接正确性，且对于必须带参数的页面（如详情页）不能很好的进行跳转前约束；\n- 通过约定的目录结构生产路由跳转方法，通过指定的 API 跳转而不是手写 url；\n- 给特定的页面添加 route.config.ts 描述进入该页面时所需参数类型；\n#### 页面跳转希望传递自定义对象时无法操作；\n- 跳转 API 支持传入任意类型的参数，在跳转到的页面中通过 useParams 获取该参数；\n#### 无法描述“从页面返回时”的场景，例如进入某个页面进行操作并返回后，刷新当前页面这种场景难以实现；\n- 将跳转行为封装为一个 Promise，当从跳转到的页面返回时，这个 Promise 被 resolve；\n- 支持设定当前页面的 BackData，作为上述 Promise 的参数；\n#### 路由鉴权写起来相当啰嗦，而且难以和业务代码解耦；\n- 页面的 route.config.ts 支持配置页面的 Ext 参数（例如所需的权限码），生成路由时自动写入到跳转 API 中；\n- 增加路由中间件功能，在跳转时按顺序进入中间件，则可以添加中间件对上述 Ext 参数结合当前用户身份进行权限校验；\n","readmeFilename":"README.md"}