0.2.0 • Published 10 years ago

node-debug-switcher v0.2.0

Weekly downloads
10
License
MIT
Repository
github
Last release
10 years ago

node-debug-switcher

NPM version Build Status Coverage Status dependency Status devDependency Status

Switch NODE_DEBUG per request.

Usage

Express 4.0

var express = require('express');
var cookieParser = require('cookie-parser');
var switcher = require('node-debug-switcher').express;

app = express();
app.use(cookieParser());
// Switch by cookie
app.use(switcher('name', type: 'cookie'));
// Switch by query
app.use(switcher('name', type: 'query'));

Koa

var koa = require('koa');
var switcher = require('node-debug-switcher').koa;

app = koa();
// Switch by cookie
app.use(switcher('name', type: 'cookie'));
// Switch by query
app.use(switcher('name', type: 'query'));

Options

Secure

Encrypt the value.

switcher = require('node-debug-switcher').koa
switcher('name', secure: true, password: 'foo', type: 'cookie')

Execute node-debug-switcher <string_to_encrypt> <password> to get the encrypted value.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2014 Daisuke Taniwaki. See LICENSE for details.

0.2.0

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago