{"id":13447772,"url":"https://github.com/firebase/superstatic","last_synced_at":"2026-03-17T20:03:04.173Z","repository":{"id":11142565,"uuid":"13509061","full_name":"firebase/superstatic","owner":"firebase","description":"Superstatic: a static file server for fancy apps.","archived":false,"fork":false,"pushed_at":"2026-03-04T15:54:18.000Z","size":2248,"stargazers_count":1107,"open_issues_count":26,"forks_count":84,"subscribers_count":62,"default_branch":"master","last_synced_at":"2026-03-09T19:54:43.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firebase.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-10-11T20:33:09.000Z","updated_at":"2026-02-25T18:26:07.000Z","dependencies_parsed_at":"2024-01-03T00:07:19.036Z","dependency_job_id":"bddb97cb-13aa-43af-a0c8-ccc1eccbddf2","html_url":"https://github.com/firebase/superstatic","commit_stats":{"total_commits":787,"total_committers":29,"mean_commits":"27.137931034482758","dds":0.6060991105463787,"last_synced_commit":"72817719d4011df1d1a4e18084b01200130fc2e3"},"previous_names":["divshot/superstatic"],"tags_count":129,"template":false,"template_full_name":null,"purl":"pkg:github/firebase/superstatic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Fsuperstatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Fsuperstatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Fsuperstatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Fsuperstatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firebase","download_url":"https://codeload.github.com/firebase/superstatic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Fsuperstatic/sbom","scorecard":{"id":345463,"data":{"date":"2025-08-11","repo":{"name":"github.com/firebase/superstatic","commit":"b9d0e65863ead68a73fb1bce44349b5a168affa4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 7/20 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/firebase/superstatic/node-test.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating node:0.10 to node:0.10@sha256:c32b4d56f05c69df6e87d06bf7d5f6a5c6a0e7bcdb8e5ffab0e7a1853a90008f","Warn: npmCommand not pinned by hash: Dockerfile:4","Warn: goCommand not pinned by hash: .github/workflows/node-test.yml:16","Warn: npmCommand not pinned by hash: .github/workflows/node-test.yml:51","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   1 out of   3 npmCommand dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/firebase/.github/SECURITY.md:1","Info: Found linked content: github.com/firebase/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/firebase/.github/SECURITY.md:1","Info: Found text in security policy: github.com/firebase/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":2,"reason":"SAST tool is not run on all commits -- score normalized to 2","details":["Warn: 7 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-75v8-2h7p-7m2m","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T06:56:19.151Z","repository_id":11142565,"created_at":"2025-08-18T06:56:19.152Z","updated_at":"2025-08-18T06:56:19.152Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30630027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:26.499Z","updated_at":"2026-03-17T20:03:04.160Z","avatar_url":"https://github.com/firebase.png","language":"JavaScript","readme":"# Superstatic   [![NPM Module](http://img.shields.io/npm/v/superstatic.svg?style=flat-square)](https://npmjs.org/package/superstatic) [![NPM download count](https://img.shields.io/npm/dm/superstatic.svg?style=flat-square)](https://npmjs.org/package/superstatic) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/firebase/superstatic/node-test.yml?style=flat-square)\n\nSuperstatic is an enhanced static web server that was built to power.\nIt has fantastic support for HTML5 pushState applications, clean URLs,\ncaching, and many other goodies.\n\n## Documentation\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Configuration](#configuration)\n* [API](#api)\n  * [Middleware](#middleware)\n  * [Server](#server)\n* [Providers](#providers)\n  * [Authoring Providers](#authoring-providers)\n* [Run Tests](#run-tests)\n* [Changelog](https://github.com/firebase/superstatic/blob/master/CHANGELOG.md)\n* [Contributing](#contributing)\n\n## Installation\n\nSuperstatic should be installed globally using npm:\n\nFor use via CLI\n\n```\n$ npm install -g superstatic\n```\n\nFor use via API\n\n```\nnpm install superstatic --save\n```\n\n## Usage\n\nBy default, Superstatic will simply serve the current directory on port\n`3474`. This works just like any other static server:\n\n```\n$ superstatic\n```\n\nYou can optionally specify the directory, port and hostname of the server:\n\n```\n$ superstatic public --port 8080 --host 127.0.0.1\n```\n\n## Configuration\n\nSuperstatic reads special configuration from a JSON file (either `superstatic.json`\nor `firebase.json` by default, configurable with `-c`). This JSON file enables\nenhanced static server functionality beyond simply serving files.\n\n**public:** by default, Superstatic will serve the current working directory (or the\nancestor of the current directory that contains the configuration json being used).\nThis configuration key specifies a directory *relative to the configuration file* that\nshould be served. For example, if serving a Jekyll app, this might be set to `\"_site\"`.\nA directory passed as an argument into the command line app supercedes this configuration\ndirective.\n\n**cleanUrls:** if `true`, all `.html` files will automatically have their extensions\ndropped. If `.html` is used at the end of a filename, it will perform a 301 redirect\nto the same path with `.html` dropped.\n\nAll paths have clean urls\n\n```json\n{\n  \"cleanUrls\": true\n}\n```\n\n**rewrites:** you can specify custom route recognition for your application by supplying\nan object to the routes key. Use a single star `*` to replace one URL segment or a\ndouble star to replace an arbitrary piece of URLs. This works great for single page\napps. An example:\n\n```json\n{\n  \"rewrites\": [\n    {\"source\":\"app/**\",\"destination\":\"/application.html\"},\n    {\"source\":\"projects/*/edit\",\"destination\":\"/projects.html\"}\n  ]\n}\n```\n\n**redirects:** you can specify certain url paths to be redirected to another url by supplying configuration to the `redirects` key. Path matching is similar to using custom routes. `redirects` use the `301` HTTP status code by default, but this can be overridden by configuration.\n\n```json\n{\n  \"redirects\": [\n    {\"source\":\"/some/old/path\", \"destination\":\"/some/new/path\"},\n    {\"source\":\"/firebase/*\", \"destination\":\"https://www.firebase.com\", \"type\": 302}\n  ]\n}\n```\n\nRoute segments are also supported in the `redirects` configuration. Segmented `redirects` also support custom status codes (see above):\n\n```json\n{\n  \"redirects\": [\n    {\"source\":\"/old/:segment/path\", \"destination\":\"/new/path/:segment\"}\n  ]\n}\n```\n\nIn this example, `/old/custom-segment/path` redirects to `/new/path/custom-segment`\n\n**headers:** Superstatic allows you to set the response headers for certain paths as well:\n\n```json\n{\n  \"headers\": [\n    {\n      \"source\" : \"**/*.@(eot|otf|ttf|ttc|woff|font.css)\",\n      \"headers\" : [{\n        \"key\" : \"Access-Control-Allow-Origin\",\n        \"value\" : \"*\"\n      }]\n    }, {\n      \"source\" : \"**/*.@(jpg|jpeg|gif|png)\",\n      \"headers\" : [{\n        \"key\" : \"Cache-Control\",\n        \"value\" : \"max-age=7200\"\n      }]\n    }, {\n      \"source\" : \"404.html\",\n      \"headers\" : [{\n        \"key\" : \"Cache-Control\",\n        \"value\" : \"max-age=300\"\n      }]\n    }]\n  }\n}\n```\n\n**trailingSlash:** Have full control over whether or not your app has or doesn't have trailing slashes. By default, Superstatic will make assumptions for on the best times to add or remove the trailing slash. Other options include `true`, which always adds a trailing slash, and `false`, which always removes the trailing slash.\n\n```json\n{\n  \"trailingSlash\": true\n}\n```\n\n**i18n:** Internationalized content can be served based on `accept-language` or `x-country-code` headers.\n\nImagine a setup with the following files:\n\n```\n- public/\n  - index.html\n  - i18n/\n    - fr_ca/\n      - index.html\n    - ALL_ca/\n      - index.html\n    - fr/\n      - index.html\n```\n\nWith `i18n` enabled, when a request is received for `/index.html` with the `accept-language` header set to `fr` (and no `x-country-code`), the content at `public/i18n/fr/index.html` will be returned as a response.\n\nIf `accept-language: fr` and `x-country-code: ca` are passed, the content at `public/i18n/fr_ca/index.html` will be returned for `/index.html`.\n\nFor more information about how content is resolved when using `i18n`, see [the Firebase Hosting documentation of the feature](https://firebase.google.com/docs/hosting/i18n-rewrites).\n\n```json\n{\n  \"i18n\": {\n    \"root\": \"/intl\"\n  }\n}\n```\n\n## API\n\nSuperstatic is available as a middleware and a standalone [Connect](http://www.npmjs.org/package/connect) server. This means you can plug this into your current server or run your own static server using Superstatic's server.\n\n\n### Middleware\n\n```js\nvar superstatic = require('superstatic')\nvar connect = require('connect');\n\nvar app = connect()\n\t.use(superstatic(/* options */));\n\napp.listen(3000, function() {\n\n});\n\n```\n\n### `superstatic([options])`\n\nInstantiates middleware. See an [example](https://github.com/firebase/superstatic/tree/master/examples) for detail on real world use.\n\n* `options` - Optional configuration:\n  * `fallthrough` - When `false`, render a 404 page from within Superstatic rather than calling through to the next middleware. Defaults to `true`.\n  * `config` - A file path to your application's configuration file (see [Configuration](#configuration)) or an object containing your application's configuration. If an object is provided, it will be merged into existing config in a `superstatic.json`.\n  * `protect` - Adds HTTP basic auth. Example:  `username:password`\n  * `env`- A file path your application's environment variables file or an object containing values that are made available at the urls `/__/env.json` and `/__/env.js`. See the documentation detail on [environment variables](http://docs.firebase.com/guides/environment-variables).\n  * `cwd` - The current working directory to set as the root. Your application's `public` configuration option will be used relative to this.\n  * `compression` - An option which controls superstatic's response compression. Pass in a standard `compression(req, res, next)` Express middleware function to override the default compression behavior (for example, require [shrink-ray](https://www.npmjs.com/package/shrink-ray) to enable advanced compression schemes such as brotli, or require node.js' stock [compression](https://www.npmjs.com/package/compression) middleware yourself to change the compression quality and caching behavior). Any other truthy value will default to the stock node.js middleware.\n\n### Server\n\n```js\nvar superstatic = require('superstatic').server;\n\nvar app = superstatic(/* options */);\n\nvar server = app.listen(function() {\n\n});\n```\n\nSince Superstatic's server is a barebones Connect server using the Superstatic middleware, see the [Connect documentation](https://github.com/senchalabs/connect) on how to correctly instantiate, start, and stop the server.\n\n### `superstatic([options])`\n\nInstantiates a Connect server, setting up Superstatic middleware, port, host, debugging, compression, etc.\n\n* `options` - Optional configuration. Uses the same options as the middleware, plus a few more options:\n  * `port` - The port of the server. Defaults to `3474`.\n  * `host` or `hostname` - The hostname of the server. Defaults to `localhost`.\n  * `errorPage` - A file path to a custom error page. Defaults to [Superstatic's error page](https://github.com/firebase/superstatic/blob/master/templates/not_found.html).\n  * `debug` - A boolean value that tells Superstatic to show or hide network logging in the console. Defaults to `false`.\n  * `compression` - A boolean value that tells Superstatic to serve gzip/deflate compressed responses based on the request Accept-Encoding header and the response Content-Type header. Defaults to `false`.\n  * `gzip` **[DEPRECATED]** - A boolean value which is now equivalent in behavior to `compression`. Defaults to `false`.\n\n## Providers\n\nSuperstatic reads content from **providers**. The default provider for Superstatic\nreads from the local filesystem. Other providers can be substituted when initializing\nSuperstatic:\n\n```js\nsuperstatic({\n  provider: require('superstatic-someprovider')({\n    provider: 'options'\n  })\n});\n```\n\n### Authoring Providers\n\nImplementing a new provider is quite simple. You simply need to create a function\nthat takes a request and pathname and returns a Promise. The Promise should:\n\n1. Resolve `null` when content isn't found (i.e. a 404 response).\n2. Resolve with a metadata object as described below when content is found.\n3. Reject when an error occurs in the content-fetching process.\n\nThe metadata object returned by a provider needs the following properties:\n\n* **stream:** A readable stream for the content.\n* **size:** The length of the content.\n* **etag:** (optional) a content-unique string such as an MD5 hash computed from the content\n* **modified:** (optional) a Date object for when the content was last modified\n\nA simple in-memory store provider can be found at `lib/providers/memory.js` in\nthis repo as a simple reference example of a provider.\n\n**Note:** The pathname will be URL-encoded. You should make sure your provider\nproperly handles files with non-standard characters (spaces, unicode, etc).\n\n## Run Tests\n\nIn superstatic module directory:\n\n```\nnpm install\nnpm test\n```\n\n## Contributing\n\nWe LOVE open source and open source contributors. If you would like to contribute to Superstatic, please review our [contributing guidelines](https://github.com/firebase/superstatic/blob/master/CONTRIBUTING.md) before you jump in and get your hands dirty.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Fsuperstatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebase%2Fsuperstatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Fsuperstatic/lists"}