1.0.6 • Published 4 years ago

server-inspect-proxy v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

server-inspect-proxy

Node inspect proxy, you can start remotely debugging with it.

Install

npm i server-inspect-proxy

or

yarn add server-inspect-proxy

Usage

You can define the inspection port and which will be automatically proxied.

NODE_OPTIONS=--inspect node ./index.js
node --inspect ./index.js
node --inspect --inspect-port=xxx ./index.js
// index.js
const { debug } = require('server-inspect-proxy')
const { createServer } = require('http')

const server = createServer((req, res) => {
  res.statusCode = 200;
  res.end("success");
}).listen(3320);

debug(server)

And open chrome://devtools/bundled/js_app.html?ws=YOUR_APP_HOST/__debug__

20200805005432

1.0.6

Use in koa/express:

const Koa = require('koa');
const app = new Koa();
const { debug } = require('../dist/index')

const main = ctx => {
  ctx.response.body = 'Hello World';
};

app.use(main);

debug(app.listen(3322))
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago