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

pjblog-plugin-demo

v1.0.3

Published

pjblog template plugin description

Readme

一套用于PJBlog插件开发的完整模板。它支持两种开发模式:

  • Base development 基础开发,用于定义插件后端逻辑。
  • Advance development 高级开发,用于定义插件后台管理界面的开发。

Clone repository

$ git clone [email protected]:pjblog/pjblog-template-plugin.git
$ cd pjblog-template-plugin
$ rm -rf .git
$ npm i

模板项目包含了Base developmentAdvance development两种开发模式。这两种模式分别对应packages下面的2个文件夹

Config Blog

首先,对package.json的进行配置。在orm字段中选择开发的数据库。

目前支持以下几种数据库

  • mysql
  • mssql
  • mongodb
  • oracle
  • postgres

具体的配置请参考NPM模块 typeorm

package.json中以下的字段是必须配置的:

  • name 必须以 pjblog-plugin- 开头
  • version 版本号
  • description 插件描述
  • repository 代码仓库地址,一般使用github仓库地址
  • homepage 插件主页地址,一般是npmjs.com上的模块网络地址

注意: 如果本插件依赖其他插件,那么必须在pjblog.extends中说明。

其他的配置不需要改动,默认即可。

Base development

代码地址: /packages/widget/。你可以根据插件文档开发。

开发过程需要新开命令行窗口

# 开发
$ npm run widget:watch 

# 编译
$ npm run widget:build

Advance development

代码地址: /packages/advance/。这里是一个前端项目,我们采用微前端方案进行页面注入,具体参考qiankun

首先,如果你的插件需要用到高级功能,那么你需要在package.jsonpjblog.advance指定编译后的文件夹地址。如果使用本项目,那么不需要改动。如果不需要高级功能,请将pjblog.advance字段删除。

其次,我们使用[email protected]开发,目前没有支持其他框架的开发。比如[email protected],后续我们会跟进补充扩展。理论上,基于微前端开发,那么这个插件不局限使用什么框架来开发,应用项目本就隔离。

如果基于非官方推荐的项目编译,那么参考qiankun模块的应用开发说明。

最后,我们需要使用以下的命令开发(基于新开命令行窗口):

# 开发
$ npm run advance:watch

# 编译
$ npm run advance:build

在开发高级用用页面的时候,我们推荐使用[email protected] + @pjblog/hooks模块进行开发。请将高级项目开发中的模块依赖全部写入devDependencies中,而非dependencies,这点很重要。

Start PJBlog

基于新开命令行窗口

$ pjblog start

你可以在插件 -> 高级 -> 页面中实时查看效果。

Compile

$ npm run build

Publish

在发布前,首先要确保你已经登录NPM命令行

$ npm whoami

如果没有登录,你需要

$ npm login

登录完毕后,你通过

$ npm run publish

进行发布,系统将自动到处需要的内容到.publish文件夹,进行发布。

注意: 发布前请修改你的项目的版本 package.json 中的 version字段。