New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

koa-logs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-logs

a middleware for koa requset log

latest
Source
npmnpm
Version
2.0.9
Version published
Maintainers
1
Created
Source

koa-logs

Build Status Coverage Status License npm Version

a simple middleware for record koa logs!

Features

  • support logs type(process.stdout, stream, console)
  • suport kinds of type(tiny, WTODO More)

Usage

use default output console.log

let app = koa();
app.use(log());
app.listen(3000);

use output process.stdout

let app = koa();
app.use(log('tiny', {
    handle: process.stdout
}));
app.listen(3000);

use output fs.createWriteStream

let app = koa();
app.use(log('tiny', {
    handle: fs.createWriteStream(path)
}));
app.listen(3000);

use skip

let app = koa();
app.use(log('tiny', {
    handle: fs.createWriteStream(path),
    skip: function(ctx){
        if(ctx.url === '/ignore'){
            return true;
        }else{
            return false;
        }
    }
}
}));
app.listen(3000);

Install

$ npm install koa-logs -g

Test

$ npm test
$ npm run cover
$ npm run lint

License

MIT

Keywords

koa

FAQs

Package last updated on 14 Nov 2016

Did you know?

Socket

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.

Install

Related posts