# gulp-chsi-rev2

> 基于gulp的插件，静态资源后面添加时间戳作为版本号，达到去缓存的作用。

Latest version **1.0.0** (published 2019-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-chsi-rev2
pnpm add gulp-chsi-rev2
yarn add gulp-chsi-rev2
bun add gulp-chsi-rev2
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-24 |
| First published | 2019-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xiaolong120111 |
| Maintainers | xiaolong120111 |
| Keywords | gulpplugin, chsi rev, gulp, gulp rev, rev |

## Links

- npm: https://www.npmjs.com/package/gulp-chsi-rev2
- Repository: https://github.com/longyixuan/gulp-chsi-rev2
- Homepage: https://github.com/longyixuan/gulp-chsi-rev2#readme
- Issues: https://github.com/longyixuan/gulp-chsi-rev2/issues
- npm.io page: https://npm.io/package/gulp-chsi-rev2

## Dependencies (3)

- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [through2](https://npm.io/package/through2.md) ^0.6.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.0

## Recent versions

- 1.0.0 (latest) — 2019-01-24
- 1.1.2 — 2019-01-24

## README

## gulp-chsi-rev

基于gulp的插件，静态资源后面添加时间戳作为版本号，达到去缓存的作用。

## Installation安装

```bash
npm install gulp-chsi-rev2
```

## Usage用法

```js
var gulp = require('gulp');
var chsiRev = require('gulp-chsi-rev2');

gulp.task('rev',function() {
    gulp.src("./test/test.html")
        .pipe(chsiRev())
        .pipe(gulp.dest('./'));
});
```

## Example实例

```js
var gulp = require('gulp');
var chsiRev = require('gulp-chsi-rev2');

gulp.task('rev',['revCss'],function() {
    gulp.src("./test/test.html")
        .pipe(chsiRev({revison: 10000}))
        .pipe(gulp.dest('./dest'));
});

gulp.task('revCss',function () {
    return gulp.src('./test/styles/test.css')
        .pipe(chsiRev(revison: 10000))
        .pipe(gulp.dest('./dest/styles/'))
});
gulp.task('default',['rev']);
```

### before: test.css
```css
body{background:url('../images/bg.png')}
```

### after: test.css
```css
body{background:url("../images/bg.png?v=1482737522923")}
```
### before: test.html
```html
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <link rel="stylesheet" href="./styles/test.css" type="text/css" />
</head>
<body>
    <div>
        <img src="./images/test.png" />
    </div>
    <script src="./scripts/test.js" type="text/javascript"></script>
</body>
</html>
```
### after: test.html

```html
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <link rel="stylesheet" href="./styles/test.css?v=1482737522924" type="text/css" />
</head>
<body>
    <div>
        <img src="./images/test.png?v=148273752295" />
    </div>
    <script src="./scripts/test1482737522926.js" type="text/javascript"></script>
</body>
</html>
```

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