node-debug-switcher

0.2.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i node-debug-switcher

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • dtaniwaki