I'm afraid I don't understand the question - are you trying to write some code that runs on an Espruino device that disconnects it from the currently connected computer when a button is pressed?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm afraid I don't understand the question - are you trying to write some code that runs on an Espruino device that disconnects it from the currently connected computer when a button is pressed?
Or are you trying to do something else?