Is there any way to get/set pause mode from JS?

As per title, I would like to be able to get/set the pause state from a JS
panel, is it possible?