npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

egg-development-proxyworker

v1.2.0

Published

A proxy worker for debugging worker on egg.

Downloads

31

Readme

egg-development-proxyworker

NPM version build status Test coverage David deps Known Vulnerabilities npm download

A proxy worker for debugging worker on egg

DEPRECATED, use egg-bin debug instead.

As in development stage, when we modify the code and save, the application will automatically restart the worker. But every time the worker's updates make the debug port change, And VSCode is required to attach to a fixed debug port. So we enabled a proxy service called proxyworker. Worker debugging information will be proxied to this service. And then VSCode through the fixed attach to proxyworker to debug the worker

The following are the installation steps:

1. Install egg-development-proxyworker plugin
npm i egg-development-proxyworker --save
2. Enable the plugin
// config/plugin.js
exports.proxyworker = {
  enable: true,
  package: 'egg-development-proxyworker',
};

// config/config.default.js
// If 10086 is occupied, you can specify the other port number through this configuration
exports.proxyworker = {
  port: 10086,
};
3. Add debug configuration in .vscode/launch.json :
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Egg",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "npm",
      "windows": {
        "runtimeExecutable": "npm.cmd"
      },
      "runtimeArgs": [
        "run", "dev", "--", "--debug"
      ],
      "port": 5858
    },
    {
      "name": "Attach Agent",
      "type": "node",
      "request": "attach",
      "port": 5856
    },
    {
      "name": "Attach Worker",
      "type": "node",
      "request": "attach",
      "restart": true,
      "port": 10086
    }
  ],
  "compounds": [
    {
      "name": "Debug Egg",
      "configurations": ["Launch Egg", "Attach Agent", "Attach Worker"]
    }
  ]
}

As V8 Debugger Legacy Protocol will be removed after Node.js 8.x, And replace the use of Inspector Protocol

The new protocol has three major advantages:

  1. Support very large JavaScript object
  2. Support ES6 Proxy
  3. Support Source Map better

For and only for Node.js >= 7.x we should use Inspector Protocol for debugging.

In the above debug configuration, you need to modify some parameters to open the new protocol:

  • Launch Egg adjust the parameter "runtimeArgs": ["run", "debug"]
  • Attach Worker add the parameter "protocol": "inspector"

In addition, if you use the new protocol can also use chrome devtools for debugging, debugging address:

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:10087
4. Start debugging

In VSCode, switch to the debug page. Select the Debug Egg configuration to start.

More VSCode Debug usage can be found in the documentation: Node.js Debugging in VS Code

Questions & Suggestions

Please open an issue here.

License

MIT