# gulp-css-url-versioner

> A gulp plugin for versioning the CSS property: url

Latest version **1.1.1** (published 2016-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-css-url-versioner
pnpm add gulp-css-url-versioner
yarn add gulp-css-url-versioner
bun add gulp-css-url-versioner
```

## 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.1.1 |
| Published | 2016-03-11 |
| First published | 2014-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | jansanchez |
| Maintainers | jansanchez |
| Keywords | gulpfriendly, gulpplugin, gulp, css, url, versioner, version |

## Links

- npm: https://www.npmjs.com/package/gulp-css-url-versioner
- Repository: https://github.com/jansanchez/gulp-css-url-versioner
- Homepage: https://github.com/jansanchez/gulp-css-url-versioner#readme
- Issues: https://github.com/jansanchez/gulp-css-url-versioner/issues
- npm.io page: https://npm.io/package/gulp-css-url-versioner

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [through2](https://npm.io/package/through2.md) ^0.6.3
- [css-url-versioner](https://npm.io/package/css-url-versioner.md) ^1.1.3

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2016-03-11
- 1.1.0 — 2015-09-15
- 1.0.9 — 2015-09-15
- 1.0.8 — 2015-09-01
- 1.0.7 — 2015-06-20
- 1.0.6 — 2015-01-20
- 1.0.5 — 2014-11-06
- 1.0.4 — 2014-11-05
- 1.0.3 — 2014-11-05
- 1.0.2 — 2014-11-04
- 1.0.0 — 2014-11-04

## README

# Gulp CSS Url Versioner [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Code Climate Status][codeclimate-image]][codeclimate-url]

> A gulp plugin for versioning the CSS property: url.
> Based on: [css-url-versioner](https://github.com/jansanchez/css-url-versioner)

## Getting Started

### Install:

```
npm install --save-dev gulp-css-url-versioner
```

### How to use:

```
var gulp = require('gulp'),
    cssVersioner = require('gulp-css-url-versioner');

gulp.task('styles', function () {
    return gulp.src('src/css/withoutVersion.css')
    .pipe(cssVersioner())
    .pipe(gulp.dest('dist/css/withVersion.css'));
});
```

#### With Stylus and Git


```
var gulp = require('gulp'),
    stylus = require('gulp-stylus'),
    cssVersioner = require('gulp-css-url-versioner');

gulp.task('stylus', function () {
    return gulp.src('src/styles/*.styl')
    	.pipe(stylus())
		.pipe(cssVersioner({lastcommit: true}))
		.pipe(gulp.dest('dist/styles/'));
});
```


#### Input
```
.fancybox-overlay {
  background: url(fancybox_overlay.png);
}
@font-face {
	font-family: "OpenSans";
	font-style: normal;
	font-weight: normal;
	src: url("os.eot");
	src: url("os.eot#iefix") format('embedded-opentype'), 
		 url("os.ttf") format('truetype'), 
		 url("os.woff") format('woff'), 
		 url("os.svg#OpenSans") format('svg');
}
```

#### Output
```
.fancybox-overlay {
  background: url(fancybox_overlay.png?v=6bfae27);
}
@font-face {
	font-family: "OpenSans";
	font-style: normal;
	font-weight: normal;
	src: url("os.eot?v=6bfae27");
	src: url("os.eot?v=6bfae27#iefix") format('embedded-opentype'), 
		 url("os.ttf?v=6bfae27") format('truetype'), 
		 url("os.woff?v=6bfae27") format('woff'), 
		 url("os.svg?v=6bfae27#OpenSans") format('svg');
}
```




### Options:


#### variable:
Default: `v`

You can customize the variable name in '?myVariable=yyyymmdd'

```
{variable: 'myVariable'}
```

#### version:
Default: `yyyymmdd`

By default the version is the current date. You can also customize it:

```
{version: '0.0.2'}
```

#### lastcommit: 
Default: `false`

Set to true if you want to use the short version of your last commit as your version.

```
{lastcommit: true}
```

#### version: Math.random()
```
{version: Math.random()}
```

#### debug 
Default: `false`

Set to true, if you want to print the relative path for each processed file

```
{debug: true}
```


[downloads-image]: http://img.shields.io/npm/dm/gulp-css-url-versioner.svg
[npm-url]: https://www.npmjs.org/package/gulp-css-url-versioner
[npm-image]: http://img.shields.io/npm/v/gulp-css-url-versioner.svg

[travis-url]: https://travis-ci.org/jansanchez/gulp-css-url-versioner
[travis-image]: http://img.shields.io/travis/jansanchez/gulp-css-url-versioner.svg

[coveralls-url]: https://coveralls.io/r/jansanchez/gulp-css-url-versioner
[coveralls-image]: https://img.shields.io/coveralls/jansanchez/gulp-css-url-versioner.svg

[codeship-url]: https://www.codeship.io/projects/44868
[codeship-image]: https://codeship.io/projects/221e0440-44c9-0132-43bc-1e738e05cfd5/status?branch=master

[codeclimate-url]: https://codeclimate.com/github/jansanchez/gulp-css-url-versioner
[codeclimate-image]: https://codeclimate.com/github/jansanchez/gulp-css-url-versioner/badges/gpa.svg

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