JSPM

template-error

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31156
  • Score
    100M100P100Q132973F
  • License

Re-throw an.

Package Exports

  • template-error

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (template-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

template-error NPM version

Re-throw an.

Install

Install with npm

$ npm i template-error --save

Usage

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:

screen shot 2015-08-11 at 3 35 27 am

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

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 11, 2015.