<commit_before># uploadcare-loader
webpack loader with all the glory of uploadcare.com

## Instalation

```bash
npm install --save whitescape/uploadcare-loader
```
or

```bash
npm install --save whitescape/uploadcare-loader
```

## Usage
In Webpack config:

```js
{
  test: /\.(jpg|png|gif)$/,
  loader: 'uploadcare',
  query: {
    publicKey: 'PUBLIC_KEY',
    privateKey: 'PRIVATE_KEY',
    statsFilePath: path.join(__dirname, 'build', 'uploadcare.json'),
    resoursePathDivider: 'app',
  },
},
```

thats it.

## Awesome part

now you can turn

```js
const img = require('./assets/image.png')
```
into

```js
// => https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/
```

or

```styl
.selector
  background-image: url('./assets/bg.png')
```
into

```css
.selector {
  background-image: url(https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/);
}
```

### Not awesome enough?
well how about that:

```js
const img = require('./assets/image.png')

//..
render() {
  return (
    <img src={'${img}-/resize/600x/-/format/jpg/-/quality/lightest/'}/>
  )
}

// results in
// <img src="https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/-/resize/600x/-/format/jpg/-/quality/lightest/" />
```

**full power of [Uploadcare CDN operations](https://uploadcare.com/documentation/cdn/) for your local assets!**
<commit_msg>readme fix<commit_after># uploadcare-loader
webpack loader with all the glory of uploadcare.com

## Instalation

```bash
npm install --save whitescape/uploadcare-loader
```
or

```bash
npm install --save-dev whitescape/uploadcare-loader
```

## Usage
In Webpack config:

```js
{
  test: /\.(jpg|png|gif)$/,
  loader: 'uploadcare',
  query: {
    publicKey: 'PUBLIC_KEY',
    privateKey: 'PRIVATE_KEY',
    statsFilePath: path.join(__dirname, 'build', 'uploadcare.json'),
    resoursePathDivider: 'app',
  },
},
```

thats it.

## Awesome part

now you can turn

```js
const img = require('./assets/image.png')
```
into

```js
// => https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/
```

or

```styl
.selector
  background-image: url('./assets/bg.png')
```
into

```css
.selector {
  background-image: url(https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/);
}
```

### Not awesome enough?
well how about that:

```js
const img = require('./assets/image.png')

//..
render() {
  return (
    <img src={'${img}-/resize/600x/-/format/jpg/-/quality/lightest/'}/>
  )
}

// results in
// <img src="https://ucarecdn.com/960b4e3a-065f-4502-be4b-55824b9d800e/-/resize/600x/-/format/jpg/-/quality/lightest/" />
```

**full power of [Uploadcare CDN operations](https://uploadcare.com/documentation/cdn/) for your local assets!**

{'fraction_non_alphanumeric': 0.19730438038187945, 'fraction_numerical': 0.053912392362411084, 'mean_word_length': 3.7125220458553794, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3154272', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1004, 'n_words': 193}