Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
hogan-engine
Advanced tools
npm install hogan-engine
Where app
is your express app instance.
// Add the engine
app.engine('html', require('hogan-engine'));
// Then just do the normal view setup
app.set('views', __dirname + '/views');
app.set('view engine', 'html');
That's it.
After installing the engine, you can use it as you would any other express templating engine.
res.render('index', { title: 'Hello World' });
And have the template views/index.html
{{> header.html}}
<h1>{{ title }}</h1>
{{> footer.html}}
Notice we included a couple partials. You don't have to do anything more then have them in the views directory for them to be loaded and rendered. Easy.
var hogan = require('hogan-engine');
// Set the root of the template directory
hogan.root = __dirname + '/views';
// Set cache to true to cache the templates, do this in production please
hogan.cache = true;
hogan('index.html', { title: 'Hello World' }, function (err, text) {
// ...
});
FAQs
Hogan.js for Express 3.x. Auto loads used partials and caches templates.
The npm package hogan-engine receives a total of 0 weekly downloads. As such, hogan-engine popularity was classified as not popular.
We found that hogan-engine 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.