highlight words

I have a json object that I display in codemirror

I also have an array of strings, and I need to apply styles to them in the editor, for example {color: red}. How can I do this?

const params = ["name", "phone"];
const jsonObj = JSON.stringify(
    { "name": "nik", "obj": { "phone": "5434", adress: "street" } },
                    theme: "default",
                    height: "auto",
                    viewportMargin: Infinity,
                    mode: {
                        name: "javascript",
                        json: true,
                        statementIndent: 4,
                    lineNumbers: true,
                    lineWrapping: true,
                    indentWithTabs: false,
                    indentUnit: 4,
                    tabSize: 4,
                    autoCloseBrackets: true,
                    readOnly: true,

I found a method “markText” in documentation. But, I don’t know how to use it in my case, because it takes the arguments start and end of the string. Maybe there is a method that will find the word I need in the text of the editor, and show me its beginning and end? so that I can use the method “markText”