Running JavaScript "and getting the resulting object"

Hi,

Is there any way to run some JavaScipt code, without any event being triggered like in Bokeh, and then get the resulting object e.g. as a JSON string?

Has anyone tried this, without having to write a component?

Many thanks