# bs-rewrite-rules

> > UI interface for adding/removing/editing Browsersync's rewrite rules

Latest version **2.1.2** (published 2016-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install bs-rewrite-rules
pnpm add bs-rewrite-rules
yarn add bs-rewrite-rules
bun add bs-rewrite-rules
```

## 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 | 2.1.2 |
| Published | 2016-11-05 |
| First published | 2015-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shane Osbourne |
| Maintainers | shakyshane |
| Keywords | browser sync plugin, response modifier |

## Links

- npm: https://www.npmjs.com/package/bs-rewrite-rules
- npm.io page: https://npm.io/package/bs-rewrite-rules

## Dependencies (1)

- [immutable](https://npm.io/package/immutable.md) ^3.7.4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2016-11-05
- 2.1.1 (next) — 2016-11-05
- 2.1.0 — 2016-10-11
- 2.0.0 — 2016-10-08
- 1.0.0 — 2015-11-10

## README

## bs-rewrite-rules

> UI interface for adding/removing/editing Browsersync's rewrite rules

### Install

```shell
npm i browser-sync bs-rewrite-rules
```

### Usage

```js
var bs = require('browser-sync').create();

bs.init({
    proxy: 'http://www.bbc.co.uk',
    plugins: ['bs-rewrite-rules']
});
```

Now access the Plugins section of the UI (address given in the console)
& you'll be presented with: 

![ui](http://s22.postimg.org/i3yi07zwx/Screen_Shot_2015_11_11_at_08_46_47.png)

### Works well with `serveStatic`

Image you have the frontend assets of a live site on your local machine.
You could use Browsersync to proxy the live site & then rewrite the links 
to point to your local files: 

```js
var bs = require('browser-sync').create();

bs.init({
    proxy: 'http://www.bbc.co.uk',
    plugins: ['bs-rewrite-rules'],
    serveStatic: ['assets'],
    rewriteRules: [
        {
            match: 'http://example.com/skin/frontend/sunspel/default/assets/css/core.min.css',
            replace: '/css/core.css'
        }
    ]
});
```

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