Regarding mizzao:sharejs: This package isn’t maintained anymore, but you can use edemaine:sharejs instead. You can use it for a simple textarea or with code editors (Codemirror and Ace).
See my blog post regarding this package:
@edemaine works on coauthor https://github.com/edemaine/coauthor which is an collaboration platform for computer science. It includes markdown support and is actively maintained.
I work on updating my collaborative online IDE based on Meteor, which I use for my coding workshops for kids since almost five years, source code is available here: https://github.com/Coding4KidsAT/coding4kids-ide
As both projects are open source, you can cherry-pick from the code, what might fit into your project.
Good luck!
BTW: I’m currently extending the ShareJS package to reuse the websocket used by Meteor. I’ll publish it in the approximately two weeks.
Regarding Ace: This package works with edemaine:sharejs: https://atmospherejs.com/qnipp/sharejs-ace
Regarding CodeMirror: I suggest to try https://atmospherejs.com/edemaine/sharejs-codemirror