An open API service indexing awesome lists of open source software.

https://github.com/fabioricali/staticbuster

Cache buster for static resources in HTML pages
https://github.com/fabioricali/staticbuster

cache cache-buster cachebuster cachebusting

Last synced: 3 months ago
JSON representation

Cache buster for static resources in HTML pages

Awesome Lists containing this project

README

        


staticbuster


Cache buster for static resources in HTML pages.





## Installation

### Node.js
```
npm install staticbuster --save
```

Imagine this scenario:

**index.html**

```html





```

You may have cache problems! staticbuster adds a cache buster for each resource. For example:

```html


```

## Usage

```javascript
const staticbuster = require('staticbuster');

staticbuster({
file: 'path/index.html'
})
.then(() => console.log('ok'))
.catch(err => console.err(err));
```

### Options

Name | Type | Default | Description
-|-|-|-
file | string or array of string | | File(s) to process
dest | string | | Optional, file destination
busterParam | string | _sb | Optional, buster param
busterValue | string | timestamp | Optional, buster value
saveCopy | boolean | true | Optional, save a copy

### CLI
```
$ staticbuster --help

Options:

-V, --version output the version number
-f, --file file to process
-d, --dest [destination] optional file destination
-b, --saveCopy [boolean] optional save a copy
-p, --busterParam [param] optional buster param, default is _sb
-v, --busterValue [value] optional buster value, default is the timestamp
-h, --help output usage information

```

## Changelog
You can view the changelog here

## License
staticbuster is open-sourced software licensed under the MIT license

## Author
Fabio Ricali