title: NodeJS (Firebase): Cannot import custom class
body: <p>I am working on a Firebase server-side code for sending push notifications. To make the code clean, I decided to move some functions to another class which I created and called <code>notificationFunctions.js</code>. </p>
  
  <p>When I do <code>const notificationFunctions = require('notificationFunctions');</code> at the top of my <code>index.js</code> and call the function from within my <code>sendNotification</code> function, I get an error when deploying my project to the cloud:</p>
  
  <pre><code>⚠  functions[sendNotifications]: Deployment error.
  Build failed: exit status 1
  npm ERR! Linux 4.4.0-108-generic
  npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "--global-style" "--production" "--fetch-retries=5" "--fetch-retry-factor=2" "--fetch-retry-mintimeout=1000" "install" "/workspace"
  npm ERR! node v6.11.5
  npm ERR! npm  v3.10.10
  npm ERR! code E404
  
  npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/notificationFunctions
  npm ERR! 404 
  npm ERR! 404  'notificationFunctions' is not in the npm registry.
  npm ERR! 404 Your package name is not valid, because 
  npm ERR! 404  1. name can no longer contain capital letters
  npm ERR! 404 It was specified as a dependency of 'functions'
  npm ERR! 404 
  npm ERR! 404 Note that you can also install from a
  npm ERR! 404 tarball, folder, http url, or git url.
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /workspace/npm-debug.log
  
  
  
  Functions deploy had errors. To continue deploying other features (such as database), run:
      firebase deploy --except functions
  </code></pre>
  
  <p>I have also added <code>"notificationFunctions": "1.0.0"</code> in my <code>package.json</code> and moved the custom function to <code>node_modules</code> folder.</p>
  
  <p>What is the right way of adding a custom class to Firebase NodeJS?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>When I follow Doug Stevenson's advise and I remove the custom class from my <code>package.json</code>, and move the class to the same directory as <code>index.js</code>, I still keep getting an error:</p>
  
  <pre><code>i  deploying functions
  i  functions: ensuring necessary APIs are enabled...
  ✔  functions: all necessary APIs are enabled
  i  functions: preparing functions directory for uploading...
  
  Error: Error parsing triggers: Cannot find module 'notificationFunctions'
  
  Try running "npm install" in your functions directory before deploying.
  </code></pre>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Ok. I figured I have to change the way I import my class to <code>require('./notificationFunctions')</code> and this removes all errors when deploying the project.</p>
  
  <p>Once I run the code on the cloud however, I get this error: <code>FIREBASE WARNING: Exception was thrown by user callback. TypeError: notificationFunctions.getNotificationPayload is not a function</code></p>
  
  <p>The way I call the function from my code is: <code>const payload = notificationFunctions.getNotificationPayload(userLanguage, senderName, groupName, messageContent, messageType);</code></p>