
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
requires node v4 or later
hapi promise view: lets you pass promises to reply.view()
this module is super basic, and probably won't work very well with your code; use this at your own risk! (and open up some issues/PRs to help this module grow)
const hpv = require('hpv')
const handlebars = require('handlebars')
// assuming 'server' is your set up hapi server w/ vision
// wrap server.views object in hpv
server.views(hpv({
engines: {
handlebars: handlebars
}
}))
server.route({
path: '/',
method: 'GET',
handler: (request, reply) => {
const promise = handleIndex(request, reply)
reply.view('index', promise)
}
})
function handleIndex (request, reply) {
return new Promise((resolve, reject) => {
resolve({
nice: 5
})
})
}
hpv(viewsOptions, options)
viewsOptions: configuration object for server.views
compileMode is force set to 'async', although you should set compileMode to let hpv know how to wrap the compile functioncompile function is wrapped in hpv's custom wrapper that passes through the contextoptions: configuration for hpv
allowPassthrough: (default: true) if context promise is not a Promise, don't throw an error and use it as the context for the templateFAQs
hapi promise views
We found that hpv 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.