I was just looking at the same thing. The electron API is there, so it works to do:
const electron = require('electron')
const clipboard = electron.clipboard;
and then make use of clipboard features, e.g. clipboard.writeText(result)
I’m too hazy on javascript imports to understand why I can’t do e.g. import {clipboard} from 'electron', or how to bring it in in a type safe way, but this does at least get text into the clipboard.