# serve-static-x

> Serve static files with cache busting capability (uses Express.static() aka serve-static)

Latest version **1.0.0** (published 2015-11-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install serve-static-x
pnpm add serve-static-x
yarn add serve-static-x
bun add serve-static-x
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-11-08 |
| First published | 2015-11-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Buster Collings |
| Maintainers | buster |
| Keywords | serve, static, serve-static, cache, diskcache, caching, diskcaching, bust, busting |

## Links

- npm: https://www.npmjs.com/package/serve-static-x
- Repository: https://github.com/busterc/serve-static-x
- Homepage: https://github.com/busterc/serve-static-x#readme
- Issues: https://github.com/busterc/serve-static-x/issues
- npm.io page: https://npm.io/package/serve-static-x

## Dependencies (1)

- [serve-static](https://npm.io/package/serve-static.md) ^1.10.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-11-08

## README

# serve-static-x [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
> Serve static files with cache busting capability; 
> uses [`Express.static()`](http://expressjs.com/4x/api.html#express.static) aka [serve-static](https://github.com/expressjs/serve-static)

Use it just like [serve-static](https://github.com/expressjs/serve-static) except now you can set an additional option named "x" that enables a custom (secret) request header to be used to bypass receiving static files.

- Use in conjunction with [`save-static`](https://github.com/busterc/save-static) for caching and re-caching files to disk.

## Install

```sh
$ npm install --save serve-static-x
```


## Usage

```js
var express = require('express');
var serveStaticX = require('serve-static-x');

var app = express();

var staticPath = path.join(__dirname, '/static/html'); // <= for example

// this is where the magic happens
app.use(serveStaticX(staticPath, {
  x: 'x-my-secret-cache-busting-header'
}));

```

## License

ISC © [Buster Collings](https://about.me/buster)


[npm-image]: https://badge.fury.io/js/serve-static-x.svg
[npm-url]: https://npmjs.org/package/serve-static-x
[travis-image]: https://travis-ci.org/busterc/serve-static-x.svg?branch=master
[travis-url]: https://travis-ci.org/busterc/serve-static-x
[daviddm-image]: https://david-dm.org/busterc/serve-static-x.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/busterc/serve-static-x

---
_Source: https://npm.io/package/serve-static-x · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
