winston-express
Express middleware to let you use winston from the browser.
Last updated 10 years ago by grobot .
Repository · Bugs · Original npm · Tarball · package.json
$ npm install winston-express 
SYNC missed versions from official npm registry.

Winston Express

Winston Express is a helper for express, that allows you to log to winston from the browser.

It is simple to use.

var winstonExpress = require('winston-express')
  , winston = require('winston')
  , express = require('express')
  , app = express.createServer();

// winstonExpress takes two parameters,
// an express app, and a winston logger instance.
winstonExpress(app, winston);

Only call winstonExpress() once, or bad things could happen

Add the following script tag to your html:

<script type="text/javascript" src="/winston/client.js"></script>

Winston Express requires jQuery to be included before itself in the browser.

From there, you are ready to go! Anywhere in your browser side code you can use winston:

winston.log('info', 'This is informational...');
winston.info('This is more info');
winston.myCustomLevel('winston is aware of error levels you define');
winston.anotherCustomLevel('but only if you define them before calling winstonExpress()');
winston.log('debug', 'meta data is also allowed', {this: 'is', meta: 'data'});

Current Tags

  • 0.1.1                                ...           latest (10 years ago)

4 Versions

  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (2)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE