npm i yjs y-websocket Start the y-websocket server: PORT=1234 node ./node_modules/y-websocket/bin/server.js Example: Observe types const yarray = doc.getArray('my-array') yarray.observe(event => { console.log('yarray was modified') }) // every time a local or remote client modifi...
npm i yjs y-websocket Start the y-websocket server: PORT=1234 node ./node_modules/y-websocket/bin/server.js Example: Observe types const yarray = doc.getArray('my-array') yarray.observe(event => { console.log('yarray was modified') }) // every time a local or remote client modifi...
你可以通过 npm 或 yarn 安装 Yjs: 代码语言:txt AI代码解释 npm install yjs 或者: 代码语言:txt AI代码解释 yarn add yjs 2. 创建共享文档 以下是一个简单的示例,展示如何使用 Yjs 共享文本数据: 代码语言:txt AI代码解释 import * as Y from 'yjs' // 创建一个共享文档 const ydoc = new Y.Doc()...
Cloud Studio代码运行 npm i yjs 另外Yjs提供了一些网络同步的库,比如通过websocket、webrtc等等,详细介绍可以查看这个文档Connection Provider。每个库除了提供客户端的jsnpm包外,还提供了对应的服务端Nodejs的实现代码供你参考和测试,可以说是非常贴心了。我使用的是webrtc方式: 代码语言:javascript 代码运行次数:0 复...
好了,在控制台执行npm run dev本地运行,浏览器打开网址,即可看到一个基础的编辑器已经创建完成。 接入Yjs 协同编辑功能 Yjs是 nodejs 社区中一个非常流行的协同编辑服务工具,它基于CRDT算法,支持很多流行的编辑器。当然它也支持 ProseMirror 而且支持的很好。
Open demo/src/app/ystream.tsx and change the variable collectionName: const collectionName = 'my-collection-name' npm run dev open [demo]{http://localhost:3000} You can run this demo in combination with the file-system demo to see filesystem and editor state synced in real-time. Work ...
npm i y-websocket Start a y-websocket server This repository implements a basic server that you can adopt to your specific use-case.(source code) Start a y-websocket server: HOST=localhost PORT=1234 npx y-websocket Client Code: import*asYfrom'yjs'import{WebsocketProvider}from'y-websocket'cons...
[root@head-kib elasticsearch-head-master]# npm install ... grunt-contrib-jasmine@1.0.3 node_modules/grunt-contrib-jasmine ├── sprintf-js@1.0.3 ├── lodash@2.4.2 ├── es5-shim@4.5.13 ├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1,...
先安装配置node.js(不会的见百度),然后在资料给的server目录先使用npm i命令安装,然后进入src中使用node app.js命令运行,再访问注意:本地的mysql密码要和app.js中的对应。 2020-07-16 21:53151回复 热评 听风QA我也是不知道怎么在app.js文件中配置用户名和密码 2020-08-01 21:27回复 旧梦空城h回复@bili...
npx y-websocket-server npm run dev npm run cypress:open "cypress:open": "cypress open" "dev": "concurrently --kill-others \" vite --host\" \"vite --host\"" Am I doing something wrong when starting cypress or is there something missing in the config file for it to be ...