Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
npm install koa-jade --save
var koa = require('koa')
, jade = require('koa-jade')
, app = koa()
app.use(jade.middleware({
viewPath: __dirname + '/views',
debug: false,
pretty: false,
compileDebug: false,
locals: global_locals_for_all_pages
}))
app.use(function* () {
yield this.render('index', locals_for_this_page, true)
})
app.listen(3000)
viewPath
: where Jade templates be stored. Default is process.cwd()
.
pretty
and compileDebug
: see Jade's docs. Default is false
.
debug
: shorthand for pretty
and compileDebug
. Default is false
.
locals
: variables that will be passed to Jade templates.
noCache
: if true
, re-compile templates when page refreshed; if false
, use cached compiler first. Can be overrided by render
's force
.
middleware(options)
: configure and create a middleware.
render(tpl, locals, force)
: render tpl
with locals
.
By default, koa-jade
stores the results of Jade.compile
as caches. If want to control it manually, use the third argument - force
:
true
: force to re-compile template instead of use cached compiler.
false
: force to use cached compiler first.
force
can be ommited.
Koa-jade sets content-type
to text/html
automatically. if wanna change it, do like this:
yield this.render('index')
this.type = 'text/plain'
FAQs
A Jade middleware for Koa
We found that koa-jade 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.