# browser-assert

> Featherweight assert module

Latest version **1.2.1** (published 2015-08-24) · 0 weekly downloads

## Install

```sh
npm install browser-assert
pnpm add browser-assert
yarn add browser-assert
bun add browser-assert
```

## 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.2.1 |
| Published | 2015-08-24 |
| First published | 2015-03-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | muji |
| Maintainers | muji |

## Links

- npm: https://www.npmjs.com/package/browser-assert
- Repository: https://github.com/socialally/browser-assert
- Homepage: https://github.com/socialally/browser-assert#readme
- Issues: https://github.com/socialally/browser-assert/issues
- npm.io page: https://npm.io/package/browser-assert

## Recent versions

- 1.2.1 (latest) — 2015-08-24
- 1.2.0 — 2015-08-18
- 1.1.1 — 2015-08-08
- 1.1.0 — 2015-08-08
- 1.0.1 — 2015-03-27

## README

Table of Contents
=================

* [Assert](#assert)
  * [Install](#install)
  * [Developer](#developer)
    * [Test](#test)
    * [Start](#start)
    * [Cover](#cover)
    * [Lint](#lint)
    * [Clean](#clean)
    * [Spec](#spec)
    * [Instrument](#instrument)
    * [Readme](#readme)
  * [License](#license)

Assert
======

> `Stability: stable`.

Featherwight `assert` function for the browser and [node](http://nodejs.org) designed to work with [browserify](http://browserify.org).

```javascript
function assert(expr, message) {
  if(!Boolean(expr)) {
    throw new Error(message || 'unknown assertion error');
  }
}
```

## Install

```
npm i browser-assert --save
```

## Developer

Developer workflow is via [gulp](http://gulpjs.com) but should be executed as `npm` scripts to enable shell execution where necessary.

### Test

Run the headless test suite using [phantomjs](http://phantomjs.org):

```
npm test
```

To run the tests in a browser context open [test/index.html](https://github.com/socialally/browser-assert/blob/master/test/index.html) or use the server `npm start`.

### Start

Serve the test files from a web server with:

```
npm start
```

### Cover

Run the test suite and generate code coverage:

```
npm run cover
```

### Lint

Run the source tree through [eslint](http://eslint.org):

```
npm run lint
```

### Clean

Remove generated files:

```
npm run clean
```

### Spec

Compile the test specifications:

```
npm run spec
```

### Instrument

Generate instrumented code from `lib` in `instrument`:

```
npm run instrument
```

### Readme

Generate the project readme file (requires [mdp](https://github.com/freeformsystems/mdp)):

```
npm run readme
```

## License

Everything is [MIT](http://en.wikipedia.org/wiki/MIT_License). Read the [license](https://github.com/socialally/browser-assert/blob/master/LICENSE) if you feel inclined.

Generated by [mdp(1)](https://github.com/freeformsystems/mdp).

[node]: http://nodejs.org
[npm]: http://www.npmjs.org
[gulp]: http://gulpjs.com
[phantomjs]: http://phantomjs.org
[browserify]: http://browserify.org
[eslint]: http://eslint.org
[mdp]: https://github.com/freeformsystems/mdp

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