Is there a way to run prosemirror on nodejs?

I use promirror-collab module & store prosemirror changes. Because of some reason, I want to fetch the latest state of my document in nodejs environment. But since the base document & changes are stored separately in different formats, can’t find a simple way to do it.

Most of the ProseMirror modules work in node.js—notably prosemirror-model and prosemirror-transform—so creating and manipulating documents there shouldn’t be a problem.

Here’s a slightly abbreviated version of how we run it server side for an import script

const jsdom = require('jsdom')
const { JSDOM } = jsdom
const {DOMParser} = require('prosemirror-model')
const {bodySchema} = require('../../app/javascript/lib/schema/index.js')
const parser = DOMParser.fromSchema(bodySchema)

...

  const dom = new JSDOM(someHTMLString)
  const jsonSerializable = parser.parse(dom.window.document, { preserveWhitespace: true }).toJSON()

We load the document from JSON (on node by calling Node.fromJSON) and it works like a charm. @jabberthonky What is the point where you got stuck?