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

lianshu-editor

v1.0.175

Published

A Notion-style rich text editor based on Tiptap for Vue 3

Downloads

3,945

Readme

Lianshu Editor

一个基于 Tiptap 的 Notion 风格富文本编辑器,专为 Vue 3 设计。

特性

  • 🎨 Notion 风格:行首加号菜单、斜杠命令、悬浮工具栏
  • 🖼️ 图片上传:支持拖拽、粘贴、点击上传
  • 🌓 主题切换:内置浅色/深色主题支持
  • 💻 代码高亮:支持 20+ 种编程语言
  • 任务列表:可勾选的待办事项
  • 📝 Markdown 快捷键:支持常用 Markdown 语法
  • 🎯 TypeScript:完整的类型定义

安装

npm install lianshu-editor

使用

基础用法

<script setup lang="ts">
import { ref } from 'vue'
import { LianshuEditor } from 'lianshu-editor'
import 'lianshu-editor/style.css'

const content = ref('<p>Hello World</p>')
</script>

<template>
  <LianshuEditor v-model="content" />
</template>

主题配置

<template>
  <LianshuEditor
    v-model="content"
    :theme="isDark ? 'dark' : 'light'"
  />
</template>

图片上传配置

<script setup lang="ts">
import { LianshuEditor, type ImageConfig } from 'lianshu-editor'

const imageUploader = async (file: File) => {
  // 上传到你的服务器
  const formData = new FormData()
  formData.append('file', file)
  const response = await fetch('/upload', {
    method: 'POST',
    body: formData
  })
  const data = await response.json()

  return {
    errorCode: 0,
    data: {
      src: data.url,
      alt: file.name
    }
  }
}

const imageConfig: ImageConfig = {
  uploader: imageUploader,
  maxSize: 5, // 最大 5MB
  acceptTypes: ['jpeg', 'jpg', 'png', 'gif', 'webp']
}
</script>

<template>
  <LianshuEditor
    v-model="content"
    :image="imageConfig"
  />
</template>

Props

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | modelValue | string | '<p></p>' | 编辑器内容(HTML) | | placeholder | string | "输入 '/' 唤起菜单..." | 占位符文本 | | editable | boolean | true | 是否可编辑 | | theme | 'light' \| 'dark' | 'light' | 主题 | | image | ImageConfig \| boolean | false | 图片配置 |

类型定义

interface ImageUploader {
  (file: File): Promise<{
    errorCode: number
    data: {
      src: string
      alt?: string
      title?: string
    }
  }>
}

interface ImageConfig {
  uploader?: ImageUploader
  maxSize?: number // MB
  acceptTypes?: string[]
}

开发构建

  • 构建完整库:npm run build
  • 仅构建 MobileEditor:npm run build:mobile

License

MIT