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

tadcode-wpsjs

v2.2.4

Published

在部署远程代码的情况下,可以远程调用`WpsjsGlobal`,实现对支持`AirScript`的多维表,智能表格等远程操作。如果你对`AirScript`,感兴趣,也能帮助你学习`AirScript`。

Readme

tadcode-wpsjs

介绍

在部署远程代码的情况下,可以远程调用WpsjsGlobal,实现对支持AirScript的多维表,智能表格等远程操作。如果你对AirScript,感兴趣,也能帮助你学习AirScript

项目地址:https://gitcode.com/caisijian/tadcode-wpsjs

When deploying remote code, you can remotely invoke WpsjsGlobal to perform remote operations on multi-dimensional tables, smart tables, and other supported features with AirScript. If you're interested in AirScript, it can also assist you in learning it.

原理是使用代理收集调用信息,之后让远程代码进行调用并且返回结果。 远程代码在tadcode-wpsjs/remoteCode目录的index.js文件中。 将其复制粘贴到对应webhook的脚本中才能支持WpsjsGlobal对象的调用。

目前已经实现对多维表的基本操作,实现了全类型支持。

如果对你有用请在gitcode给个star,谢谢。

联系我

如你有业务需要wps代码,可以点此联系我,三个工作日内必定回复。

如您公司存在敏感信息业务,需要长期人才,亦可来讯商谈。

扫一扫联系我

安装

npm install tadcode-wpsjsbun install tadcode-wpsjs

获取脚本令牌和webhook链接

获取脚本令牌

脚本令牌

webhook链接

!!!webhook链接的脚本内容必须部署为tadcode-wpsjs/remoteCode/index.js中的脚本内容。

webhook链接

案例

获取当前多维表的所有表格信息(取值操作)

import { initRemoteCallWpsjsGlobal } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const wpsjsGlobal = initRemoteCallWpsjsGlobal({ scriptToken, webhookURL,  })
const data = await wpsjsGlobal.Application.Sheet.GetSheets()
console.log(data)

多维表的重命名(赋值操作)

import { initRemoteCallWpsjsGlobal,setValue } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const wpsjsGlobal = initRemoteCallWpsjsGlobal({ scriptToken, webhookURL,  })
const sheet = wpsjsGlobal.Application.Sheets(1)
await setValue(sheet,'Name','newName')

修改记录区域字体颜色(赋值操作,此写法可以复用对象)

import type { Font } from 'application:datatable'
import { initRemoteCallWpsjsGlobal,setValue } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const wpsjsGlobal = initRemoteCallWpsjsGlobal({ scriptToken, webhookURL,  })
const range = wpsjsGlobal.Application.ActiveSheet.RecordRange([1, 2], [1, 2]).Font as unknown as Font
range.Color = '#ff00ff'
/* 注意:赋值操作依旧是远程操作。此函数会拿到最后一次赋值操作的promise */
await setValueOk()

获取当前表信息和视图信息(执行队列任务)

import { initRemoteCallWpsjsGlobal, remoteExecuteQueue } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const wpsjsGlobal = initRemoteCallWpsjsGlobal({ scriptToken, webhookURL, })
const sheetInfo = wpsjsGlobal.Application.Selection.GetActiveSheet()
const viewInfo = wpsjsGlobal.Application.Selection.GetActiveView()
const data = await remoteExecuteQueue([sheetInfo, viewInfo])
/* 注意:实际上,只执行一次请求。 */
console.log(data)

添加字段(嵌套执行)

import { initRemoteCallWpsjsGlobal } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const wpsjsGlobal = initRemoteCallWpsjsGlobal({ scriptToken, webhookURL,  })
const desc = wpsjsGlobal.Application.ActiveSheet.FieldDescriptors.FieldDescriptor('MultiLineText', 'text')
setValue(desc,'DefaultVal','默认值')
/* 此处必须setValue函数,且不应该await */
const result = await wpsjsGlobal.Application.ActiveSheet.FieldDescriptors.AddField(unwrapPromise(desc))
/* unwrapPromise仅类型安全,无运算意义 */
/* 注意:实际上,只执行一次请求。 */
console.log(result)

执行脚本并且返回(不用部署remoteCode代码)

import { remoteExecute } from 'tadcode-wpsjs'
/* scriptToken webhookURL 具体获取方式参考上面 */
const result=await remoteExecute({ scriptToken, webhookURL })
const data =await result.json()
console.log(data)

基于wps官方文档

支持

如果对你有用请在gitcode给个star