title: Can I run Firebase Functions locally?
body: <p>Is it possible to use <code>firebase-functions</code> from my laptop? If not, is <code>firebase-admin</code> the only option remaining?</p>
  <p>Here are some examples:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/63230731/how-can-i-rent-and-use-my-own-servers-for-cloud-functions/63231360#63231360">How can I rent and use my own servers for cloud functions?</a></li>
  <li><a href="https://stackoverflow.com/questions/48965147/listen-only-to-additions-to-a-cloud-firestore-collection">Listen only to additions to a cloud firestore collection?</a></li>
  <li><a href="https://stackoverflow.com/questions/59146727/does-firebase-admin-sdk-perform-any-caching">Does Firebase Admin SDK perform any caching?</a></li>
  </ul>
  <p>I am able to make an <code>index.js</code> file on my laptop, npm install <code>firebase-admin</code> module, link to my Firestore database and make changes to data just fine, using <code>admin-credentials</code>. When I also try npm install <code>firebase-functions</code> make use of event-triggers <code>onCreate/onWrite/onUpdate/onDelete</code>, they do not get any updates?</p>
  <p>To my understanding, the only way possible to make use of event-triggers is by uploading to cloud functions, since you need Google's infrastructure to use those and you can't use them on your local machine, which you can with <code>firebase-admin</code> package. You can use use the local emulator(?), but it isn't production ready and is not for that use case(?).</p>
  <p>So, in order to listen for new events on my Firestore database, only using my laptop (not Google Cloud Functions platform or some other server-hosted option), I have to use <code>.onSnapshot()</code> from <code>firebase-admin</code> npm.</p>
  <p>However that module is unable to cache, and you are left querying the whole firestore database, downloading every document.</p>
  <p>Is this correct? or is there any way possible to make <code>firebase-functions</code> work from my laptop server using <code>firebase-admin</code> + admin credentials, almost as if I uploaded the file to cloud platform. I don't require this part of data to be on the cloud, so I want to make changes and adjust firestore database from my laptop's Terminal.</p>