# abridge

> Streaming minifier for JS and CSS

Latest version **0.5.3** (published 2013-01-10) · 0 weekly downloads

## Install

```sh
npm install abridge
pnpm add abridge
yarn add abridge
bun add abridge
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2013-01-10 |
| First published | 2012-09-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Weltschmerz |
| Maintainers | Weltschmerz |

## Links

- npm: https://www.npmjs.com/package/abridge
- Repository: https://github.com/Weltschmerz/Abridge
- npm.io page: https://npm.io/package/abridge

## Dependencies (3)

- [suckle](https://npm.io/package/suckle.md) 0.5.4
- [ycssmin](https://npm.io/package/ycssmin.md) 1.0.1
- [fraction](https://npm.io/package/fraction.md) 0.2.0

## Recent versions

- 0.5.3 (latest) — 2013-01-10
- 0.5.2 — 2013-01-05
- 0.5.1 — 2013-01-05
- 0.4.0 — 2012-10-28
- 0.3.2 — 2012-10-17
- 0.3.1 — 2012-10-17
- 0.3.0 — 2012-10-15
- 0.2.10 — 2012-10-11
- 0.2.9 — 2012-10-02
- 0.2.8 — 2012-09-29
- 0.2.6 — 2012-09-26
- 0.2.5 — 2012-09-25
- 0.2.4 — 2012-09-23
- 0.2.3 — 2012-09-22
- 0.2.2 — 2012-09-22
- … 2 more at https://npm.io/package/abridge/versions

## README

# Abridge

`npm install abridge`

Abridge is a streaming compiler for CSS & JavaScript. It is a superset of [ycssmin](https://github.com/yui/ycssmin) and [uglify-js](https://github.com/mishoo/UglifyJS), with a streamable interface on top.

## Usage

```js
var abridge = require('abridge');
/* abridge.{Minifier, createStream, minify} */
```

**Piping output**

Pipe #minify output to any writable stream.

```js
abridge.minify('path/to/my/file.js').pipe(process.stdout);
```

You may use either a String or an instance of fs.ReadStream as a first argument.

```js
var inputStream = require('fs').createReadStream('path/to/my/file.css');
abridge.minify(inputStream).pipe(process.stdout);
```

**Using callback**

Throw in a callback if you desire.

```js
abridge.minify('file.js', function(err, data) {
});
```

**minify is createStream**

```js
abridge.createStream('file.css').pipe(process.stdout);
```

**Minify multiple files at once**

```js
abridge.minify(['file1.js', 'file2.js']).pipe(process.stdout);
```

**Serve minified scripts and styles**

Abridge can be integrated into a web server for quickly minifying scripts & styles.

```js
var http = require('http');
var server = http.createServer(function(req, res) {
    abridge.createStream(req.url.slice(1)).pipe(res);
});
server.listen(8080);
```

For a complete file server solution that uses Abridge minification as well as automatic gzipping, see [Lactate](https://github.com/Weltschmerz/Lactate)

##License

MIT

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