0.0.3 • Published 6 years ago

staticbuster v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Installation

Node.js

npm install staticbuster --save

Imagine this scenario:

index.html

<!DOCTYPE html>
    <html>
        <head>
            <script src="res/html2canvas.js"></script>
            <link rel="stylesheet" href="res/colpick.css">   

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

            <script src="res/html2canvas.js?_sb=1512833988607"></script>
            <link rel="stylesheet" href="res/colpick.css?_sb=1512833988607">   

Usage

const staticbuster = require('staticbuster');

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

Options

NameTypeDefaultDescription
filestring or array of stringFile(s) to process
deststringOptional, file destination
busterParamstring_sbOptional, buster param
busterValuestringtimestampOptional, buster value
saveCopybooleantrueOptional, save a copy

CLI

$ staticbuster --help

  Options:

    -V, --version              output the version number
    -f, --file <fileName>      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