Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/zedix/gulp-revmap

Hash mapping task for versionning assets.
https://github.com/zedix/gulp-revmap

Last synced: about 7 hours ago
JSON representation

Hash mapping task for versionning assets.

Awesome Lists containing this project

README

        

## Information


Packagegulp-revmap

Description
Generate JSON hash mapping of assets, for cache busting

Node Version
>= 0.4

## Usage

First, install `gulp-revmap` as a development dependency:

```shell
npm install --save-dev gulp-revmap
```

or

```shell
npm install --save-dev zedix/gulp-revmap
```

Then, add it to your `gulpfile.js`:

```js
var revmap = require('gulp-revmap');

gulp.task('scripts', function() {
gulp.src('./js/**/*.js')
.pipe(revmap('assets.json', {hashlen: 10}))
.pipe(gulp.dest('./public/dist/'))
});
```

Ouput JSON file:

```js
{
"foo.js": "fddfcf5b2a",
"bar.js": "42840c25c7"
}
```

## Options

#### options.algorithm
Type: `String`
Default value: `'md5'`

The algorithm to generate hash digests: `'sha1'`, `'md5'`, `'sha256'`, etc.

#### options.hashlen
Type: `Number`
Default value: `10`

The length of a hash digest hex value.

## LICENSE

(MIT License)

Copyright (c) 2014 zedix

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.