Is possible to execute code on nodejs core?

Hi,
i’m intrested to execute some native function on nodejs inside a ionic app. Like use webtorrent in a native way, or maybe expose some api from the phone(use different network port and similiar)… so have complete access to nodejs function instead of the client one like a simple browser. Is that possible in the latest version?