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

@vsoft_liu/vsoft-editor

v0.3.6

Published

VSEditor - 供应商无关的文档编辑器抽象层

Readme

@vsoft_liu/vsoft-editor

VsoftEditor — 供应商无关的电子病历编辑器抽象层。所有方法以 vs_fun_ 前缀命名(共 246 个),HIS 系统只接触这一套接口;更换底层编辑器厂商时只需提供新的适配器,业务代码无需改动。

当前唯一接入的供应商 SDK:think-editor-sdk(信译 ThinkEditor,WASM 运行时随包发布)。

快速开始

import { createEditor, VS_ENUM_DOC_TYPE, VS_ENUM_VIEW_MODE } from '@vsoft_liu/vsoft-editor'

const editor = createEditor() // libPath 默认指向随包发布的 /think-editor-sdk/

await editor.vs_fun_init()                              // ① 初始化(必须 await)
editor.vs_fun_newDoc('病历001', VS_ENUM_DOC_TYPE.Template)  // ② 新建/解析文档
editor.vs_fun_setViewMode(VS_ENUM_VIEW_MODE.Edit, {})   // ③ 视图模式
editor.vs_fun_load(document.getElementById('container')!) // ④ 挂载容器(Load 时必须有文档)

生命周期顺序:vs_fun_init → newDoc/parseDoc → setViewMode → load。

命名约定

| 前缀 | 含义 | |------|------| | vs_fun_* | 编辑器方法(246 个) | | vs_prop_* | 编辑器只读属性 | | VS_ENUM_* | 标准化枚举(69 个) | | VS_EVENT | 标准化事件常量(51 个) | | VS_* | 标准化类型接口 |

文档

  • API.md — 完整 API 参考:246 个方法逐方法详解(签名/参数表/json 参数/返回语义),51 个事件表,69 个枚举值表,类型参考与注意事项。HIS 集成开发请以本文档为准。
  • CHANGELOG.md — 内部对齐记录(改名/移除/新增/文档与 think-editor-sdk 差异),非对外文档。

安装

pnpm add @vsoft_liu/vsoft-editor

内部依赖自动管理 think-editor-sdk 运行时(含 .wasm 文件),无需单独安装。

零配置接入(Vite 项目)

think-editor-sdk 的 .wasm 运行时随包发布,安装后无需拷贝任何文件、无需配置 libPath。在 vite.config.ts 中一行接入:

// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { thinkEditorSdk } from '@vsoft_liu/vsoft-editor/vite'

export default defineConfig({
  plugins: [vue(), thinkEditorSdk()]
})

插件自动完成:

  • 开发模式:中间件将包内 dist/think-editor-sdk/ 挂载到 /think-editor-sdk/,pnpm dev 即可访问
  • 构建模式:writeBundle 时把 sdk 目录复制进构建产物,生产环境可访问

然后 createEditor() 不需要传 libPath(默认 /think-editor-sdk/,与插件路径对齐):

import { createEditor } from '@vsoft_liu/vsoft-editor'

const editor = createEditor() // libPath 已默认指向随包发布的运行时
await editor.vs_fun_init()

非 Vite 项目:将 node_modules/@vsoft_liu/vsoft-editor/dist/think-editor-sdk/ 目录部署为静态资源,保证 /think-editor-sdk/ 可访问即可。

自定义路径

默认对外路径是 /think-editor-sdk/。如需变更,插件与 libPath 需保持一致:

// vite.config.ts
thinkEditorSdk({ base: '/editor-sdk/' })
// 业务代码
createEditor({ libPath: '/editor-sdk/' })