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

easemob-whiteboards

v1.0.4

Published

白板(Easemob-WhiteBoard)服务端基于sockt.io,页面基于svg.js开发,所以兼容性参考上述两项即可。SDK提供了创建白板、加入白板、销毁白板三个API。加入到白板中的用户都可以在实时共享的画布上运用提供工具进行元素的绘制、拖动等操作,同时支持通过上传图片文档等作为白板页面的背景。 创建白板后会返回一个白板地址链接,客户端通过直接使用页面、ifram 或者 webview等方式集成。 ## 二、集成 1.引入sdk <script type="text/javascri

Downloads

9

Readme

一、介绍

白板(Easemob-WhiteBoard)服务端基于sockt.io,页面基于svg.js开发,所以兼容性参考上述两项即可。SDK提供了创建白板、加入白板、销毁白板三个API。加入到白板中的用户都可以在实时共享的画布上运用提供工具进行元素的绘制、拖动等操作,同时支持通过上传图片文档等作为白板页面的背景。 创建白板后会返回一个白板地址链接,客户端通过直接使用页面、ifram 或者 webview等方式集成。

二、集成

1.引入sdk 
	<script type="text/javascript" src="*/whiteboardsSdk.js"></script>
	任何引入方式都可以,没有限制
2.初始化
	var WDSdk = new whiteBoards({
		restApi: "http://wbrtc.easemob.com", //可省略,sdk内部通过dns配置
		appKey: "222#111"
	});
3.API
	有两种方式创建白板:
	1. 通过房间名加入,没有房间创建房间,有房间加入房间

	```
		/**
		 * @param {string} roomName 房间名
		 * @param {string} password 房间密码
		 * @param {string} userName im用户名
		 * @param {string} token im登录token
		 * @param {function} suc 成功的回调
		 * @param {function} error 失败的回调
		*/

		WDSdk.join({
			roomName: 'roomName',
			password: 'password',
			userName: 'userName',
			token: 'token',
			suc: (res) => {
				res.whiteBoardUrl; 为白板房间地址
			},
			error: () => {},
		})
	```
	
	2.通过单独api去创建、加入
		a.创建白板 (WDSdk.create)
			```
			/**
			 * @param {string} roomName 房间名
			 * @param {string} password 房间密码
			 * @param {string} userName im用户名
			 * @param {string} token im登录token
			 * @param {function} suc 成功的回调
			 * @param {function} error 失败的回调
			*/
		
			WDSdk.create({
				userName: 'userName',
				roomName: 'roomName',
				password: 'password',
				token: 'token',
				suc: (res) => {
					window.location = res.whiteBoardUrl;
				},
				error: () => {}
			});
			```
		b.加入白板 
			加入白板2中方式分别是:
			1.joinByRoomId 通过已经创建的房间ID加入;
			2.joinByRoomName 通过已经创建的房间名称加入;
			```
			/**
			 * 1 通过房间ID加入
			 * @param {string} roomId 房间Id
			 * @param {string} password 房间密码
			 * @param {string} userName im用户名
			 * @param {string} token im登录token
			 * @param {function} suc 成功的回调
			 * @param {function} error 失败的回调
			*/
			WDSdk.joinByRoomId({
				userName: userName,    //im用户名
				roomId: roomId,        //im用户名
				token: "token",         //im登陆后token
				suc: function(res){
					window.location = res.whiteBoardUrl;
				},
				error: function(err){
					console.log("err", err);
				}
			});

			/**
			 * 2 通过房间名加入
			 * @param {string} roomId 房间Id
			 * @param {string} password 房间密码
			 * @param {string} userName im用户名
			 * @param {string} token im登录token
			 * @param {function} suc 成功的回调
			 * @param {function} error 失败的回调
			*/
			WDSdk.joinByRoomName({
				userName: userName,
				roomName: roomName,
				token: "token",
				suc: function(res){
					window.location = res.whiteBoardUrl;  //同joinByRoomId返回
				},
				error: function(err){
					console.log("err", err);
				}
			});
			```

	3.销毁白板
		```
		WDSdk.destroy({
			roomId: roomId,
			token: "1233",
			suc: function(res){
				console.log(res);
			},
			error: function(err){
				console.log("err", err);
			}
		});
		```