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

mydemo11

v202440.1.1

Published

1. 主要逻辑在 `generateCode.js` 2. 通过[astexplorer](https://astexplorer.net/)把需要转化成的代码,转化成对应的ast,然后按需拼凑ast用来最终代码生成, 或通过 `@babel/parser` 解析代码,获得`ast`,通过 `@babel/generator` 生成代码 #### build

Readme

JSPluginSDK

  1. 主要逻辑在 generateCode.js
  2. 通过astexplorer把需要转化成的代码,转化成对应的ast,然后按需拼凑ast用来最终代码生成, 或通过 @babel/parser 解析代码,获得ast,通过 @babel/generator 生成代码

build

  npm run g # 同时生成 js 和ts
  # or
  npm run gts # 只生成ts
  npm run gjs # 只生成js

使用babel/generator 转换ts为ast

  1. 在 web/ast/2ast/2Ast.js 粘贴需要转换的code
  2. 运行 npm run ast 即可在 web\ast/2Ast 下生成对应的json
  3. 打开 web/ast/2ast 下的json,查看对应的ast
  4. 自行获取需要转化的ast已做备用

开发plugin-engine(js wallpaper)接口

  1. 首先运行 npm i or yarn 安装依赖
  2. 运行 npm run g 生成ts/js代码 ==> generated文件夹,此文件夹代码是自动生成,不要手动修改任何代码,否则下次自动生成会覆盖掉
  3. 在 plugin-engine\ts 文件夹中编写相关接口,如:JSFR_App_V1.ts 中 getName
    • 原则上所有接口是参照 generated 文件的接口,但实际有些接口时不需要实现的
    • 所以实际上只需要实现接口文件夹 下必须实现的接口接口
    • 所以必须实现的接口,参照:fr_appImplWrapper.h 中 REGISTER_FUNC,其他类的接口也是类似的查找(如不清楚,可以咨询群里其他开发者)
    • generated 下的 js,是提供给 c++ 开发人员验证中间层接口使用的,可以不用理会,c++开发人员使用的demo验证
    • 高级接口使用senior-demo 验证 (ts)
    • senior-demo demo使用,只需要新建对应的components文件夹,它会自动处理组件引入,当然有些组件可以写在一个vue文件中,例如:Destroy.vue 就是包含2个button测试用例
    • plugin-engine\ts 下的文件夹结构是和generated对应的,有一些是原样导入,但大部分是不是,可以参考已有文件
    • 特别注意 callback 下的文件,由于要使用 typedoc 生成文档,所以编写是要特殊处理下,详细可以参照某一个例子即可
    • 如果需要修改PluginSDK\Plugins\JSPluginManager\web\src\lib下逻辑以改变自动生成 generated 代码,需要和c++人员沟通对接修改
    • 特别注意: 在所有接口中,如果返回的值是一个 接口对象, 则需要使用set方法将返回的result重新设置,原因是:当前的接口类,继承至对应中间层接口类,会产生多余 {uuid: xxx, value: xxx}, 这个uuid实际上是没有任何意义的,且会造成干扰
    async new(obj: FPDObject): Promise<FPDDest> {
        const result = await this.New(obj);
        const dest = new FPDDest();
        dest.set(result);
        return dest;
    }

高级接口(js-engine)相关

约定俗称的命名规范:

  1. 小写打头的,表示高级接口,例如 app: APP 其中App是它的类型(原型类)
  2. $ 打头的表示中间层接口,即是js wallpaper层接口,例如 $app 下的 addFileAttachment2
  3. 大写打头的表示底层接口,即是c++ wallpaper 层接口,例如 AddFileAttachment2

高级接口 中间层接口 底层接口