
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
koa-driftwood
Advanced tools
A tiny piece of express middleware for logging requests using QubitProducts/driftwood.
npm i driftwood koa-driftwood
Just call koa-driftwood
with an instance of driftwood and mount it in your Koa app before everything else:
const createLogger = require('driftwood')
const Koa = require('koa')
const router = require('koa-router')()
const koaLogger = require('koa-driftwood')
createLogger.enable({ '*': 'trace' })
const log = createLogger('my-app')
const app = new Koa()
app.use(koaLogger(log))
router.get('/', (ctx) => { res.body = 'Wooo!' })
router.get('/400', (ctx) => { ctx.status = 400; ctx.body = 'You dun goofed' })
router.get('/500', (ctx) => { ctx.status = 500; ctx.body = 'We dun goofed' })
app.use(router.routes())
app.listen(1119, () => {
log.info('my-app started!')
})
Options can be passed as a second argument.
A string, regex, function or array of the former, to match URLs that you don't want to log:
{
ignore: ['/status', /^\/status/, (url) => url.indexOf('/status') > -1]
}
FAQs
Koa middleware for logging with driftwood
The npm package koa-driftwood receives a total of 1 weekly downloads. As such, koa-driftwood popularity was classified as not popular.
We found that koa-driftwood 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.