# minify-stream

> minify javascript in a stream using uglify-js

Latest version **2.1.0** (published 2020-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install minify-stream
pnpm add minify-stream
yarn add minify-stream
bun add minify-stream
```

## 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.0 |
| Published | 2020-08-21 |
| First published | 2017-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 6 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Renée Kooi |
| Maintainers | goto-bus-stop, toddself |
| Keywords | minify, stream, uglify-js |

## Links

- npm: https://www.npmjs.com/package/minify-stream
- Repository: https://github.com/goto-bus-stop/minify-stream
- Issues: https://github.com/goto-bus-stop/minify-stream/issues
- npm.io page: https://npm.io/package/minify-stream

## Dependencies (6)

- [xtend](https://npm.io/package/xtend.md) ^4.0.1
- [terser](https://npm.io/package/terser.md) ^4.7.0
- [duplexify](https://npm.io/package/duplexify.md) ^4.1.1
- [from2-string](https://npm.io/package/from2-string.md) ^1.1.0
- [concat-stream](https://npm.io/package/concat-stream.md) ^2.0.0
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^1.5.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2020-08-21
- 2.0.1 — 2020-06-08
- 2.0.0 — 2020-03-31
- 1.2.1 — 2019-11-02
- 1.2.0 — 2018-05-17
- 1.1.0 — 2017-09-27
- 1.0.0 — 2017-09-27

## README

# minify-stream

minify javascript in a stream using uglify-js

[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]

[npm-image]: https://img.shields.io/npm/v/minify-stream.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/minify-stream
[travis-image]: https://img.shields.io/travis/goto-bus-stop/minify-stream.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/minify-stream
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard

## Install

```
npm install minify-stream
```

## Usage

```js
var minifyStream = require('minify-stream')

fs.createReadStream('app.js')
  .pipe(minifyStream())
  .pipe(fs.createWriteStream('app.min.js'))
```

## API

### `minifyStream(?options)`

Create a new minify stream. Write a Javascript file or bundle to it.
Possible `options` are:

 - `uglify` - An uglify module to use, defaults to [`terser`](https://npmjs.com/package/terser).
   It must have an uglify-compatible `minify()` function.
 - All other options are passed to the `minify()` function as the second parameter.
   See the [terser docs](https://github.com/fabiosantoscode/terser#minify-options) for available options.

`minify-stream` adds inline source maps by default. Use [`exorcist`](https://npmjs.com/package/exorcist)
to extract source maps from the output stream into a separate file. If you don't need source maps, pass
the `sourceMap: false` option to disable them.

```js
minifyStream({ sourceMap: false })
```

## License

[MIT](LICENSE.md)

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