title: How to use custom modules in Twilio Functions?
body: <p>I was looking for a way to simplify and extract some of the code into a custom common.js module to make my Twilio function more readable.</p>
  <p>I was expecting the serverless api to take the custom js file automatically and let me require it where I wanted it, but after deploying, it cant be found.</p>
  <p>Is there a proper way if any, to do something like:</p>
  <pre><code>const utils = require('./libs/utils.js');
  exports.handler = async function(context, event, callback) {
      ...
      utils.do_this();
  </code></pre>
  <p>Trying this brings me to:</p>
  <pre><code>{&quot;Message&quot;:&quot;Cannot find module './libs/utils.js'\nRequire stack:\n- /var/task/handlers/ZN5be18c53f5acf0299a224607fdeccedb.js\n- /var/task/node_modules/runtime-handler/index.js\n- /var/task/runtime-handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js&quot;,&quot;name&quot;:&quot;Error&quot;,&quot;stack&quot;:&quot;Error: Cannot find module './libs/utils.js'\nRequire stack:\n- /var/task/handlers/ZN5be18c53f5acf0299a224607fdeccedb.js\n- /var/task/node_modules/runtime-handler/index.js\n- /var/task/runtime-handler.js\n- /...
  </code></pre>