Skip to content

Commit

Permalink
style(readme): actualizo readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jansanchez committed Oct 21, 2015
1 parent 6690c05 commit 0091728
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

### Install:

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

### How to use:

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

fs.readFile('test/css/test.css', 'utf8', function (err, data) {
Expand All @@ -28,7 +28,7 @@ fs.readFile('test/css/test.css', 'utf8', function (err, data) {

### or

```
```js
var data = '.some_selector{background-image: url("img/sprite.png");}';

var cssVersioned = cssVersioner({
Expand All @@ -49,7 +49,7 @@ Required: `true`

Here go the css content we want versioning

```
```js
{content: '.some_selector{background-image: url("img/sprite.png");}'}
```

Expand All @@ -58,7 +58,7 @@ Default: `v`

Here go the variable of our version, for '?myVariable=yyyymmdd'

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

Expand All @@ -67,7 +67,7 @@ Default: `yyyymmdd`

Here you go a custom version if you so desire, but if we do not put this key, then the default version will be the current date.

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

Expand All @@ -76,15 +76,15 @@ Default: `false`

If we want that version to be our short version of last commit in git, configured 'lastcommit' to true.

```
```js
{lastcommit: true}
```

### Examples

#### lastcommit: true

```
```js
var data = '.some_selector{background-image: url("img/sprite.png");}';

var cssVersioned = cssVersioner({
Expand All @@ -99,7 +99,8 @@ console.log(cssVersioned.output);
```

#### lastcommit: true and variable: 'myVersion'
```

```js
var data = '@font-face{
font-family: 'gotham';
src: url("fonts/gotham.svg#gotham") format('svg');
Expand All @@ -118,7 +119,8 @@ console.log(cssVersioned.output);
```

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

```js
var data = '.some_selector{background-image: url("img/sprite.png");}';

var cssVersioned = cssVersioner({
Expand Down

0 comments on commit 0091728

Please sign in to comment.