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

@bigbigbird/zeditor

v2.0.5

Published

a simple editor

Readme

ZEditor(Vue版)

Description

一款简单、小清新的编辑器

在线演示
github

UI

image

image

Install

npm install @bigbigbird/zeditor -S

Quick Start

dist目录是js和css捆绑在一起的
part目录是js和css分离的

import Vue from 'vue'
import ZEditor from '@bigbigbird/zeditor'

Vue.component(ZEditor.name, ZEditor)
// or
@Component({
  components: {
    'z-editor': ZEditor
  }
})
export default class NameComponent extends Vue{
  //...
}
/** props-start */

// 默认没有提交按钮
hasBtn: boolean = false;

// 主题(r-粉红色,g-护眼绿,b-天空蓝,p-紫色),默认没有主题
// 也可以在其父元素或祖先元素上添加类'r'|'g'|'b'|'p'
theme: 'r'|'g'|'b'|'p' = '';

// 参数配置,默认为下面这个
options: object = {
  // 编辑内容的最大字节数
  maxsize: 65535,
  image: {
    // 上传的最大图片或插入图片外链数量
    count: 5,
    // 小于指定字节数会进行base64编码
    base64: 60000
  },
  audio: {
    // 单次上传音频或插入音频外链的最大数量
    count: 1,
    // 小于指定字节数会进行base64编码
    base64: 0
  },
  video: {
    /** 单次上传视频或插入视频外链的最大数量 */
    count: 1,
    /** 小于指定字节数会进行base64编码 */
    base64: 0
  }
};

/** props-end */

/** events-start */

// 输入事件 @input="input($event)"
input(innerHTML: string) {
  //...
}

// 前提hasBtn传入true
// 点击提交按钮事件 @recieveContent="recieveContent($event)"
recieveContent(obj: {
  innerHTML: string,
  innerText: string,
  media: {
    image: { type: 'url'|'base64', src: string},
    audio: { type: 'url'|'base64', src: string},
    video: { type: 'url'|'base64', src: string},
  }
}) {
  console.log(obj);
}

// 文件上传事件 @uploadFile="uploadFile($event)"
uploadFile(obj: {
  type: 'image' | 'audio' | 'video', file: any, callback: (v: string | boolean, t?: number) => void
}) {
  const callback = obj.callback;
  // 关闭弹窗
  // 上传成功
  const src = 'http://www.example.com';
  callback(src);
  // 上传失败
  // callback(false);
  // 上传超时
  // const t = 3000; // 超时时间(单位ms)
  // callback(false, t);
}

/** events-end */
<template>
  <z-editor v-model="innerHTML" :options="options" :hasBtn="false" :theme="g" @input="input($event)" @recieveContent="recieveContent($event)"  @uploadFile="uploadFile($event)"/>
</template>

Problem

使用v-model时,如果需要重新传入innerHTML,请设置一次innerHTML的值为''(空字符串),因为内部需要记住选区的位置,所以当编辑区有值的时候,并不会重新输入并响应(但是会将输入值发射出去),重新输入会导致之前的选区丢失。

setInnerHTML(innerHTML: string) {
  this.innerHTML = '';
  this.$nextTick(() => {
    this.innerHTML = innerHTML;
  });
}

Browser Support

PC端标准浏览器和IE9+.

Security

在前端可以使用xss对html进行无害化处理
在后端可以使用jsoup对html进行无害化处理

Concat

QQ交流群:486273737
Name: 木懵の狗纸
个人QQ: 1029512956
Email: [email protected]