You can create a shared/common module that you use...
# suitescript
a
You can create a shared/common module that you use from your RESTlet and Suitelet, that way you only write code once.