# css-url-rewrite

> Node module for rewriting urls in css

Latest version **0.9.0** (published 2015-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-url-rewrite
pnpm add css-url-rewrite
yarn add css-url-rewrite
bun add css-url-rewrite
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2015-10-16 |
| First published | 2015-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | tamaspap |
| Maintainers | tamaspap |
| Keywords | browser, server, css, preprocess, rewrite, replace |

## Links

- npm: https://www.npmjs.com/package/css-url-rewrite
- Repository: https://github.com/tamaspap/css-url-rewrite
- Issues: https://github.com/tamaspap/css-url-rewrite/issues
- npm.io page: https://npm.io/package/css-url-rewrite

## 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

- 0.9.0 (latest) — 2015-10-16

## README

css-url-rewrite
===============

[![Build Status](https://travis-ci.org/tamaspap/css-replace-urls.svg?branch=master)](https://travis-ci.org/tamaspap/css-replace-urls)

Replace all `@imports` and `url()`s using a given function.

## Installation

```bash
$ npm install --save css-url-rewrite
```

## Usage

```js
function replace(url) {
  return 'http://example.com' + url;
}

var replaced = rewriteCssUrls(css, replace);
```

```css
body {
  background: url(/images/bg.png);
}
```

yields:

```css
body {
  background: url(http://example.com/images/bg.png);
}
```

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