knex-logger

Express middleware to log Knex.js queries

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
knex-logger
0.1.010 years ago10 years agoMinified + gzip package size for knex-logger in KB

Readme

knex-logger
!NPM versionnpm-imagenpm-url !Build statustravis-imagetravis-url !Code Climatecodeclimate-imagecodeclimate-url !Coverage Statuscoverage-imagecoverage-url !Dependenciesdavid-imagedavid-url !devDependenciesdavid-dev-imagedavid-dev-url
Express middleware for logging queries made by Knex.jsknex.

Install

npm install knex-logger
avn setup

Use

var env = process.env.NODE_ENV || 'development';
var knexConfig = require('./knexfile.js')[env];
var knex = require('knex')(knexConfig);
var express = require('express');
var knexLogger = require('knex-logger');

var app = express();

app.use(knexLogger(knex));

License

This project is distributed under the MIT license.