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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mizboard

v0.3.6

Published

mizhu free draw canvas with backen server

Downloads

14

Readme

实时同步画板JS工具类

绘制功能使用了fabricjs工具库,地址: http://fabricjs.com/

使用方法

npm install mizboard

简单使用示例:

import {Room, User, OperaType} from 'mizboard'

const user = new User('{username}', '{password}');
const room = new Room(user, '{dom id}', roomOption);
room.load("{roomid}")
.then(() => {
  room.setCanvasOpera({type: OperaType.PENCIL}) // 白板房间准备完毕后,设置动作为画笔
})

方法调用

  • 支持的动作 OperaType

    • 画笔
    • 擦除
    • 禁用动作(默认)
  • 支持的图形

    • 直线
    • 三角形
    • 圆形
    • 矩形
  • 支持的回调事件 RoomEvents

    • loaded 房间加载完成后
    • afterConnect socket服务连接后
    • closeConnect socket服务断开后
    • setOpera 设置动作后
    • setStyle 设置画笔样式后
    • onAddCanvas 添加页面后
    • clearCanvas 清空页面后
    • updatePPT ppt更新后
    • togglePPT 切换ppt显示后

类型

OperaType {
  PENCIL,
  MOVE,
  ERASE,
  IMAGE,
  CLOSE,
}

ShapeType {
  LINE = 20,
  TRIANGLE,
  CIRCLE,
  RECT
}

RoomOption {
  allowBoardcast?: boolean
  size?: Size
  baseURL?: string
  socketBaseURL?: string
}

打包npm包

npm run build