
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
A dust.js view engine for express.
Hoffman is installable via npm
npm i hoffman
var hoffman = require('hoffman');
app.set('views', path.join(__dirname, 'templates')); // path to your templates
app.set('view engine', 'dust');
app.engine('dust', hoffman.__express());
// works with caching
app.set('view cache', true);
// optionally load all templates into dust cache on server start
hoffman.prime(app.settings.views, function(err) {
// views are loaded
});
Reference templates by name, without extension.
Inside a route:
res.render('index', {"planet" : "world"});
Inside of a template:
hello {>partial/}
All references are from the root of the views directory. Regardless of where the host template resides.
Hoffman supports streaming the response, by augmenting the response object via middleware:
app.use(hoffman.stream);
You can then call res.stream
instead of res.render
. If you pass a callback, you will recieve the stream
object back to do with what you want, otherwise content will be streamed via res.write()
as chunks of the
template are rendered. See the stream
method code for more details.
With view cache
set to true
, templates will be cached in memory the first time they are read off disk.
With hoffman.prime(app.settings.views)
all templates inside of the view directory
will be read into memeory on server start, meaning no first disk access after the server has started.
Hoffman comes with unit tests, code coverage reports, and jshint linting, run via:
npm test
FAQs
view engine for dust
We found that hoffman 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.