Rohamgames/granax ? reverse-engineered prompt

Reverse engineered prompt

Build me a Node.js library that lets me control a Tor instance from code using the Tor control protocol.

I want it to be easy to install and use, so by default it should download and run a bundled Tor browser build, but it should also work with a system Tor install if I set an environment variable. Please make it support connecting to a control port, waiting until it is ready, handling errors, and running common Tor commands like creating a hidden service and returning the onion address and private key.

I also want a simple API that feels natural in Node, with examples for both the bundled Tor setup and the system Tor setup. If you need to look up current Tor control protocol details or Node docs online, go ahead. Please include basic tests and enough documentation so someone can get started quickly.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab