lodash-template-validator
v0.1.1
Published
Shows you, where the error is in your lodash-template
Downloads
9
Readme
lodash-template-validator
Shows you, where the error is in your lodash-template
Example
var validate = require('lodash-template-validator')
try {
validate('<% abc %>\n<%= ce.sd.<d %>')
} catch (e) {
console.log(e)
// { [SyntaxError: Unexpected token (2:11)] loc: { column: 11, line: 2 }, pos: 20 }
}
API
validate
Validates a template and throws an error if there are any syntax errors. The error will contain the exact location of the error within the template. (As far as that is possible).
Params
string
{string}: the template string
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
see CONTRIBUTING.md
Changelog
see CHANGELOG.md
Author
Nils Knappmeier
License
Released under the MIT license.