
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
handlebars-error-parser
Advanced tools
The purpose of this module is to parse the Handlebars compile exceptions messages into a more useable format which can be used in handlebars linter(s). Handlebars throws different exceptions depending the template error.
The purpose of this module is to parse the Handlebars compile exceptions messages into a more useable format which can be used in handlebars linter(s). Handlebars throws different exceptions depending the template error.
Handlebars exception types:
This module parses the exception message into:
{
minLine: 1,
minColumn: 3,
maxLine: 1,
maxColumn: 4,
message: 'foo doesn\'t match bar'
}
npm install handlebars-error-parser --save
In Node.js:
var parser = require('handlebars-error-parser').parser;
var html = '{{#foo}}{{/bar}}';
var parsed;
try {
hbs.precompile(html);
} catch (e) {
parsed = parser(e, html);
}
In browser:
<script src="./node_modules/handlebars-error-parser/index.js"></script>
var html = '{{#foo}}{{/bar}}';
var parsed;
try {
hbs.precompile(html);
} catch (e) {
parsed = window.HandlebarsErrorParser(e, html);
}
{{#foo}}{{/bar}}
foo doesn't match bar - 1:3
{{foo}}{{/foo}}
Parse error on line 1:
{{foo}}{{/foo}}
-------^
Expecting 'EOF', got 'OPEN_ENDBLOCK'
{{foo
Parse error on line 1:
{{foo
--^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'
{{#foo
Parse error on line 1:
{{#foo
---^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'
FAQs
The purpose of this module is to parse the Handlebars compile exceptions messages into a more useable format which can be used in handlebars linter(s). Handlebars throws different exceptions depending the template error.
We found that handlebars-error-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.