# template-error

> Make template errors easy to understand and fix.

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

## Install

```sh
npm install template-error
pnpm add template-error
yarn add template-error
bun add template-error
```

## 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.1.2 |
| Published | 2015-08-21 |
| First published | 2015-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | error, rethrow, template |

## Links

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

## Dependencies (4)

- [engine](https://npm.io/package/engine.md) ^0.1.5
- [kind-of](https://npm.io/package/kind-of.md) ^2.0.1
- [rethrow](https://npm.io/package/rethrow.md) ^0.2.3
- [lazy-cache](https://npm.io/package/lazy-cache.md) ^0.2.3

## 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.1.2 (latest) — 2015-08-21
- 0.1.1 — 2015-08-11
- 0.1.0 — 2015-08-11

## README

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

> Make template errors easy to understand and fix.

## Install

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

```sh
$ npm i template-error --save
```

## Usage

```js
var rethrow = require('template-error');

rethrow('\n<%= a %>\n<%= b %>', {
  data: {a: 'aaa'}
});
```

When a template variable is not defined, like `<%= b %>` in the example above, instead of getting a cryptic error message and wasting time on debugging, you get this:

<img width="560" alt="screen shot 2015-08-11 at 3 35 27 am" src="https://cloud.githubusercontent.com/assets/383994/9192549/101ba4b6-3fda-11e5-8a4f-6a03853dacd9.png">

## Related projects

[rethrow](https://www.npmjs.com/package/rethrow): Re-throw an error to get better error reporting for templates. | [homepage](https://github.com/jonschlinkert/rethrow)

## 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/template-error/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 21, 2015._

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