# rethrow

> Re-throw an error to get better error reporting for templates.

Latest version **0.2.3** (published 2015-08-21) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2015-08-21 |
| First published | 2015-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | error, handle, template |

## Links

- npm: https://www.npmjs.com/package/rethrow
- Repository: https://github.com/jonschlinkert/rethrow
- Issues: https://github.com/jonschlinkert/rethrow/issues
- npm.io page: https://npm.io/package/rethrow

## Dependencies (6)

- [ansi-red](https://npm.io/package/ansi-red.md) ^0.1.1
- [ansi-bgred](https://npm.io/package/ansi-bgred.md) ^0.1.1
- [lazy-cache](https://npm.io/package/lazy-cache.md) ^0.2.3
- [ansi-yellow](https://npm.io/package/ansi-yellow.md) ^0.1.1
- [right-align](https://npm.io/package/right-align.md) ^0.1.3
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^1.1.4

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.2.3 (latest) — 2015-08-21
- 0.2.1 — 2015-08-11
- 0.2.0 — 2015-06-15
- 0.1.0 — 2015-05-24

## README

# rethrow [![NPM version](https://badge.fury.io/js/rethrow.svg)](http://badge.fury.io/js/rethrow)

> Re-throw an error to get better error reporting for templates.

Based on [rethrow](https://github.com/jadejs/jade/blob/f2a18826a13d52e4038534043dd78f1c3723fa2c/lib/runtime.js#L202) in Jade.

**Example**

[![screen shot 2015-05-24 at 6 29 35 am](https://cloud.githubusercontent.com/assets/383994/7787511/a8b8ab90-01de-11e5-9210-709d19a88223.png)](https://github.com/jadejs/jade/blob/f2a18826a13d52e4038534043dd78f1c3723fa2c/lib/runtime.js#L202)

## Install

Install with [npm](https://www.npmjs.com/)

```sh
$ npm i rethrow --save
```

## Usage

```js
var rethrow = require('rethrow');
```

See [template-error](https://github.com/jonschlinkert/template-error) for usage examples.

## API

### [rethrow](index.js#L27)

Re-throw the given `err` in context to the offending
template expression in `filename` at the given `lineno`.

**Params**

* `err` **{Error}**: Error object
* `filename` **{String}**: The file path of the template
* `lineno` **{String}**: The line number of the expression causing the error.
* `str` **{String}**: Template string

## Related projects

* [assemble](http://assemble.io): Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… [more](http://assemble.io)
* [template-error](https://github.com/jonschlinkert/template-error): Make template errors easy to understand and fix.
* [template](https://github.com/jonschlinkert/template): Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… [more](https://github.com/jonschlinkert/template)
* [verb](https://github.com/assemble/verb): Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… [more](https://github.com/assemble/verb)

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/rethrow/issues/new)

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 11, 2015._

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