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

pages-tool

v1.1.1

Published

pages-tool是一个辅助uni-app的pages.json配置文件的开发工具。 该工具只为简化开发人员工作,优化多人开发模式,负责将pages.json中的配置分解再合并的自动化工作。 解决pages.json混乱的问题,pages.json 可通过监听初始化的配置文件然后将配置文件自动合并同步。

Readme

pages-tool 是什么

pages-tool是一个辅助uni-app的pages.json配置文件的开发工具。 该工具只为简化开发人员工作,优化多人开发模式,负责将pages.json中的配置分解再合并的自动化工作。 解决pages.json混乱的问题,pages.json 可通过监听初始化的配置文件然后将配置文件自动合并同步。

pages.json 痛点

1.公有、私有混合,造成模块化开发,移植困难。

2.团队开发,多人同时编辑该文件,代码提交,遇到冲突合并问题。

3.pages多个配置文件过长,后期维护困难。

pages-tool 的愿望

1.满足系统功能模块化。

2.全局与私有解耦合。

3.避免团队开发不会同时编辑一个文件。

4.方便模块解耦、配置。

pages-tool 执行流程

1.通过交互执行命令npx pages-tool 展示 执行 init or watch?

init watch

执行init or watch?此时初始化init文件和watch文件 init文件将初始化获取pages.json中已有的配置信息(pages,easycom,globalStyle,tabBar,subPackages,condition等配置文件)

1-1.若选择执行 init 则提示“请输入要配置的目录” 输入的配置文件(如:pages,config)主要用来承载pages.json中的子配置项,执行initDir方法,若根目录下没有上述的配置文件,则会初始化生成pages,config等配置目录文件。

1-2.若pages文件中包含多个文件夹 则会在对应的文件夹下新增router.json文件,该文件主要配置当前文件夹下需要配置在pages.json中的文件路由,若当前的pages.json文件中pages路由存在当前文件夹中,则会将pages配置的路由映射到文件router.json中。

1-3.config文件夹下主要初始化pages.json中常用到的配置项如condition,easycom,globalStyle,tabBar映射成对应的json文件。

1-4.分包文件路由若在pages.json的subPackages中存在,则会将分包路由配置映射到根目录的分包文件夹中。

执行 init or watch? init

watch 2-1.若执行watch命令 则提示“请输入要监听的文件目录”如(pages,config,os_project,tn_components)。

2-2.由于watch文件中已将监听的文件如(router.json,condition.json,easycom.json,globalStyle.json,tabBar.json,subPackages.json)写死配置好,所以无需手动输入该配置。

2-3.输入完监听的文件目录后,则会循环遍历pages文件中的router.json、config文件中的condition.json,easycom.json,globalStyle.json,tabBar.json以及分包文件中subPackages.json。

2-4.监控以上各目录文件,发生新建或修改时,自动拉取配置,并同步到pages.json。这样就完成了pages.json文件的自动化更新配置。

你要如何做

转到应用根目录下,运行

npm install pages-tool

 npx pages-tool
 
 //对应用进行初始化,创建config目录、sub-packages目录、workers目录,这步不是必须,你也可以在今后的开发中,自己创建
 执行 init or watch?
 >init
 watch

 //对文件进行监控
 执行 init or watch?
 init
 >watch