Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/zedix/gulp-revmap
- Owner: zedix
- Created: 2014-01-08T21:57:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-08T22:40:25.000Z (almost 11 years ago)
- Last Synced: 2023-06-07T11:01:06.086Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Information
Packagegulp-revmapDescription
Generate JSON hash mapping of assets, for cache bustingNode 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.