I was trying to use the CodeJar editor plugin but the setup is confusing me. I was following the documentation and other examples too but still don't understand it. So my question is, is CodeJar a server-side or a client-side plugin? Why I am asking this is I used a CDN link to import codeJar as a module but the term codeJar is not being recognized in my js file. This probably means codeJar is not being imported to be assigned but I clearly imported it. But on the other hand, there is a line in the code to get the editor element i.e const editor = document.querySelector(".editor");, this can't be used in server-side because we are accessing client-side element. This is probably something obvious I missed. Can someone give me clarity on this? Thanks in advance.
Their documentation: https://github.com/antonmedv/codejar#getting-started
THIS is a working demo seems like it is running on the client side??? : https://codepen.io/antonmedv/pen/PoPoGwg
const highlight = (editor) => {
const code = editor.textContent
editor.innerHTML = code
}
const editor = document.querySelector(".editor");
const jar = new CodeJar(editor, highlight);
<script defer type="module">
import { CodeJar } from 'https://medv.io/codejar/codejar.js'
</script>
<div class="editor"></div>