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 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-wps-airscript

v1.0.0

Published

快速创建wps airscript项目

Readme

create-wps-airscript

介绍

用于快速创建wps airscript项目,使用日常流行的前端开发方式进行开发,最后将其打包成适合airscript的脚本代码。

相对于直接在WPS AirScript脚本编辑器中写代码,优势在于:

  • 支持typescript
  • 支持使用任意npm包
  • 支持使用airscript不支持的语法(官方文档),最终转换成es5
  • 使用rollup打包,可压缩混淆代码

项目默认使用 wps-airscript-router ,可定义脚本内部路由,并通过webhook传递不同的路由参数调用对应的处理函数,以实现复杂的功能。你也可不使用或手动移除此包,只进行简单的脚本开发。

项目中自带安装wps-airscript-types,可使用airscript中全局变量的类型声明和代码提示。

安装使用

npx create-wps-airscript my-airscript-project
cd my-airscript-project
npm install

然后就可以编辑src/index.ts,编写你的脚本了。

构建airscript脚本

npm run build

dist目录下会生成airscript脚本文件,包含未经压缩混淆的index.js和压缩混淆后的index.min.js。根据你的需要,将其复制粘贴到WPS AirScript脚本编辑器中即可。

配置

{
    "version": "",
    "copyright": "",
    "description": "",
    "scripts": ["src/index.ts"]
}

说明:

  • version:版本号,会作为注释添加到最终生成的代码前。
  • copyright:版权声明,会作为注释添加到最终生成的代码前。
  • description:脚本描述,会作为注释添加到最终生成的代码前。
  • scripts:脚本入口文件,重要,必填,默认为["src/index.ts"],你也可以修改为你定义的文件名。如果你需要生成多个脚本,可以配置多个入口文件,如["src/index.ts", "src/other.ts"],编译后会在dist目录下生成index.js、index.min.js、other.js、other.min.js。