在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/y-ipfs-connector开源软件地址:https://github.com/ipfs-shipyard/y-ipfs-connector开源编程语言:JavaScript 100.0%开源软件介绍:y-ipfs-connectorNOT BEING ACTIVELY MAINTAINED
Use it!Retrieve this with npm: $ npm install y-ipfs-connector --save Example// you need to create and inject a IPFS object
const IPFS = require('ipfs')
const Y = require('yjs')
require('y-ipfs-connector')(Y)
// other Yjs deps:
require('y-memory')(Y)
require('y-array')(Y)
require('y-text')(Y)
// create IPFS node
const ipfs = new IPFS({
EXPERIMENTAL: {
pubsub: true // need this to work
}
})
Y({
db: {
name: 'memory'
},
connector: {
name: 'ipfs', // use the IPFS connector
ipfs: ipfs, // inject the IPFS object
room: 'Textarea-example-dev'
},
sourceDir: '/bower_components', // location of the y-* modules
share: {
textarea: 'Text' // y.share.textarea is of type Y.Text
}
}).then(function (y) {
// bind the textarea to a shared text element
y.share.textarea.bind(document.getElementById('textfield'))
} Signature
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论