# cache-breaker

> Cache Breaking Tasks

Latest version **0.0.4** (published 2014-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install cache-breaker
pnpm add cache-breaker
yarn add cache-breaker
bun add cache-breaker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-05-01 |
| First published | 2014-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Shane Osbourne |
| Maintainers | shakyshane |
| Keywords | cache, bust, break |

## Links

- npm: https://www.npmjs.com/package/cache-breaker
- Repository: https://github.com/shakyShane/cache-breaker
- Issues: https://github.com/shakyShane/cache-breaker/issues
- npm.io page: https://npm.io/package/cache-breaker

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) 2.2.1

## 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

- 0.0.4 (latest) — 2014-05-01
- 0.0.3 — 2014-04-30
- 0.0.2 — 2014-04-30
- 0.0.1 — 2014-04-29

## README

#Cache Breaking Tasks [![Build Status](https://travis-ci.org/shakyShane/cache-breaker.svg?branch=master)](https://travis-ci.org/shakyShane/cache-breaker)

**Note: This modules does nothing with the file system, that means you'll have to read/write files yourself, or wait for
the Grunt & Gulp Plugins**


##Install

```
npm install cache-breaker
```

##Use in project

```
var cacheBreaker = require("cache-breaker");
```

###Usage Examples

**Append a timestamp as query string**

```js
var string   = '<link href="/style.css" /><link href="/style2.css" />';

cacheBreaker.breakCache(string, ['style.css', 'style2.css']);

// output
// <link href="/style.css?rel=23452341" /><link href="/style2.css?rel=23452341" />

```

**Append a timestamp in the filename**

```js
var string   = '<link href="/style.css" />';

cacheBreaker.breakCache(string, 'style.css', {position: 'filename'});

// output
// <link href="/style.56432352.css" />

```


**Overwrite an exiting timestamp**

Use this when you have rewrite rules in place.

```js
var string   = '<link href="/style.2452345.css" />';

cacheBreaker.breakCache(string, 'style.*.css', {position: 'overwrite'});

// output
// <link href="/style.56432352.css" />

```

##TODO

- [ ] Grunt Plugin
- [ ] Gulp Plugin
- [x] Accept file src for creating MD5 hash
- [x] Allow user-specified string in place of timestamp

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