{"id":15239096,"url":"https://github.com/shahradelahi/node-tor-control","last_synced_at":"2025-04-06T18:13:59.742Z","repository":{"id":225426550,"uuid":"765459259","full_name":"shahradelahi/node-tor-control","owner":"shahradelahi","description":"A NodeJs library to communicate with Tor-Control ","archived":false,"fork":false,"pushed_at":"2025-03-29T04:02:15.000Z","size":160,"stargazers_count":77,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T22:55:39.090Z","etag":null,"topics":["javascript","nodejs","tor"],"latest_commit_sha":null,"homepage":"https://npmjs.com/tor-ctrl","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shahradelahi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-01T00:41:18.000Z","updated_at":"2025-03-18T03:38:05.000Z","dependencies_parsed_at":"2024-03-02T02:49:01.729Z","dependency_job_id":"1a3af386-ffa3-4954-a26c-84a0be5d2d07","html_url":"https://github.com/shahradelahi/node-tor-control","commit_stats":null,"previous_names":["shahradelahi/node-tor-control"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-tor-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-tor-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-tor-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Fnode-tor-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahradelahi","download_url":"https://codeload.github.com/shahradelahi/node-tor-control/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526761,"owners_count":20953143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","nodejs","tor"],"created_at":"2024-09-29T10:05:17.621Z","updated_at":"2025-04-06T18:13:59.710Z","avatar_url":"https://github.com/shahradelahi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tor-ctrl\n\n[![CI](https://github.com/shahradelahi/node-tor-control/actions/workflows/ci.yml/badge.svg)](https://github.com/shahradelahi/node-tor-control/actions/workflows/ci.yml)\n[![NPM Version](https://img.shields.io/npm/v/tor-ctrl)](https://www.npmjs.com/package/tor-ctrl)\n[![Install Size](https://packagephobia.com/badge?p=tor-ctrl)](https://packagephobia.com/result?p=tor-ctrl)\n[![License](https://img.shields.io/github/license/shahradelahi/node-tor-control)](/LICENSE)\n\n_tor-ctrl_ is a simple library to connect to a Tor control port and send commands to it.\n\n## 📦 Installation\n\n```bash\nnpm install tor-ctrl\n```\n\n## 📖 Usage\n\nIn below example, we are requesting for a new identity from Tor.\n\n```typescript\nimport { TorControl } from 'tor-ctrl';\n\nconst tc = new TorControl({\n  host: 'localhost',\n  port: 9051,\n  // Or, if you want to control via Tor Unix socket:\n  // socketPath: '/var/run/tor/control',\n  password: 'secure-password'\n});\n\nawait tc.connect();\n\nconst { data } = await tc.getNewIdentity();\nconsole.log(data); // { code: 250, message: 'OK' }\n\nawait tc.disconnect();\n```\n\n###### Send a Custom Command\n\nIf you don't know the available commands, please first check out the official the [Tor Control Protocol](https://spec.torproject.org/control-spec/commands.html) specifications.\n\n```typescript\nconst { data, error } = await tc.sendCommand(['GETINFO', 'version', 'config-file']);\nconsole.log(data); // [ { code: NUM, message: STRING }, ... ]\n```\n\nFor more examples, check out the [examples](/examples) directory.\n\n## 🤝 Contributing\n\nWant to contribute? Awesome! To show your support is to star the project, or to raise issues on [GitHub](https://github.com/shahradelahi/node-tor-control).\n\nThanks again for your support, it is much appreciated! 🙏\n\n## License\n\n[GPL-3.0](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi) and [contributors](https://github.com/shahradelahi/node-tor-control/graphs/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fnode-tor-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahradelahi%2Fnode-tor-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Fnode-tor-control/lists"}