Skip to content
Snippets Groups Projects
Commit 330434ee authored by Kevin Jahns's avatar Kevin Jahns
Browse files

update npm example

parent 2f0216bf
No related branches found
No related tags found
No related merge requests found
...@@ -58,11 +58,17 @@ You only need to include the `y.js` file. Yjs is able to automatically require m ...@@ -58,11 +58,17 @@ You only need to include the `y.js` file. Yjs is able to automatically require m
npm install --save yjs % add all y-* modules you want to use npm install --save yjs % add all y-* modules you want to use
``` ```
When using npm, you also need to import all modules you want to use. If you don't include via script tag, you have to explicitly include all modules! (Same goes for other module systems)
``` ```
Y = require('yjs') var Y = require('yjs')
require('y-array')(Y) // add the y-array type to Yjs require('y-array')(Y) // add the y-array type to Yjs
// require('y-websockets-client')(Y) // do the same for all modules you want to use require('y-websockets-client')(Y)
require('y-memory')(Y)
require('y-array')(Y)
require('y-map')(Y)
require('y-text')(Y)
// ..
// do the same for all modules you want to use
``` ```
# Text editing example # Text editing example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment