# mini-unassert

> remove assert calls from a stream of javascript

Latest version **1.1.0** (published 2018-06-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mini-unassert
pnpm add mini-unassert
yarn add mini-unassert
bun add mini-unassert
```

Provides the command `mini-unassert`.

## 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 | 1.1.0 |
| Published | 2018-06-29 |
| First published | 2018-06-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Renée Kooi |
| Maintainers | goto-bus-stop |
| Keywords | assert, browserify, browserify-transform, optimization, production, transform, unassert |

## Links

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

## Dependencies (4)

- [through2](https://npm.io/package/through2.md) ^2.0.3
- [transform-ast](https://npm.io/package/transform-ast.md) ^2.4.3
- [scope-analyzer](https://npm.io/package/scope-analyzer.md) ^2.0.1
- [estree-is-require](https://npm.io/package/estree-is-require.md) ^1.0.0

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

- 1.1.0 (latest) — 2018-06-29
- 1.0.1 — 2018-06-24
- 1.0.0 — 2018-06-24

## README

# mini-unassert

a small and fast unassert transform

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

It transforms `assert` calls to `void` expressions. Use a minifier like [terser](https://github.com/fabiosantoscode/terser) to completely remove them.

Input:

```js
var assert = require('assert')
assert(true)
assert.equal(typeof x, 'string')
assert(sideEffectCall())
assert.throws(function () {})
```

Output:

```js
;
void (true)
void (typeof x, 'string')
void (sideEffectCall())
void (function () {})
```

After minification:

```js
sideEffectCall();
```

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

## Install

```
npm install mini-unassert
```

## Usage

It works as a stream and as a browserify transform.

```js
var unassert = require('mini-unassert')
fs.createReadStream('file.js')
  .pipe(unassert({ modules: ['assert', 'power-assert', 'nanoassert'] }))
  .pipe(fs.createWriteStream('file.unassert.js'))
```

```js
browserify -g mini-unassert -g uglifyify
```

## API

### `stream = unassert(opts={})`

Create a stream that replaces assert calls with `void` expressions.

* `opts.modules` is an array of assertion module names, defaulting to `['assert']`.

### `b.transform(unassert, opts={})`

Add `unassert` as a browserify transform. `b` is an instance of browserify.

* Set `opts.global` to run it on all files, including dependencies in node_modules. (recommended)
* `opts.modules` is an array of assertion module names, defaulting to `['assert']`.

## License

[Apache-2.0](LICENSE.md)

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