npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fireshaker

v1.0.33

Published

CLI tool that optimizes & deploys your Firebase Functions so they run faster and have shorter cold starts

Downloads

4

Readme

Fireshaker

Fireshaker is a CLI tool that automatically optimizes & deploys your Firebase Functions.

Usually, the more Firebase Functions you have in one project the more dependencies you add. Even the Functions that are not using these dependencies have them installed in their node_modules. This slows both cold and warm starts of your functions.

Almost always more than half of the modules can be removed. Thus the functions can start proportionally faster.

For example - in the first project that we helped to optimize we reduced the size of the node_modules by 53% on average.

Supported languages

  • TypeScript

How does Fireshaker work?

When you deploy Firebase Functions the whole functions folder gets uploaded and all the dependencies in the package.json are installed even when they are not used in the function that you have deployed.

We solve that by isolating Firebase Functions that are statically exported from the index.ts then prunning their source code and dependencies. The whole process looks like this:

  1. Build the project using the npm build script from functions package.json
  2. Extract the exported Firebase Functions triggers
  3. For every Firebase Function that will be deployed we create a temporary copy of the functions folder and do all the following steps:
  4. Delete all exports except for the exported Firebase Function that will be deployed
  5. Delete all unreachable source files
  6. Delete all unused dependencies and devDependencies
  7. Build the project again
  8. Delete the Typescript source files
  9. Deploy the Firebase Function to the current project

Are Google Cloud Functions supported?

Fireshaker currently supports only Firebase Functions. General Google Cloud Functions aren't supported right now but it's on the roadmap.

Installation

This will install Fireshaker as a CLI. Requires at least Node.js 10.

npm i -g fireshaker

Usage

Navigate to the root of your project (where is your firebase.json file) and deploy your functions the same way as you would with the Firebase CLI. Fireshaker respects your Firebase configuration.

Your Firebase functions need to be statically exported from your root index.ts file.

Deploy only specific functions

fireshaker deploy func1 func2 func3

Deploy all functions

fireshaker deploy