{"_id":"@dreamed-atlas/tor-downloader","_rev":"1-7aaf3b9443bffa1b4dcba72acf955f0b","name":"@dreamed-atlas/tor-downloader","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dreamed-atlas/tor-downloader","version":"1.0.0","description":"A NodeJS library to download Tor binary for several platforms and architectures","keywords":["tor","binary","downloader","dreamed-atlas"],"license":"MIT","author":{"name":"Dreamed Atlas","url":"https://github.com/DreamedAtlas"},"homepage":"https://github.com/DreamedAtlas/tor-downloader","repository":{"type":"git","url":"git+https://github.com/DreamedAtlas/tor-downloader.git"},"scripts":{"build":"tsc","lint:check":"prettylint \"src/**/*.ts\"","lint:fix":"prettier --write \"src/**/*.ts\"","prepare":"husky install","test":"jest"},"main":"dist/index.js","types":"dist/index.d.js","engines":{"node":">=10.12.0"},"devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/jest":"^26.0.23","@types/node":"^15.6.0","@types/rimraf":"^3.0.0","husky":"^6.0.0","jest":"^27.0.3","jest-mock-extended":"^1.0.15","lint-staged":"^11.0.0","prettier":"^2.3.0","prettylint":"^1.0.0","ts-jest":"^27.0.1","typescript":"^4.2.4"},"dependencies":{"node-stream-zip":"^1.13.4","rimraf":"^3.0.2","xz":"^2.0.2"},"gitHead":"4dca82fec6aee2807e5503cb0080c1d18ab2647e","bugs":{"url":"https://github.com/DreamedAtlas/tor-downloader/issues"},"_id":"@dreamed-atlas/tor-downloader@1.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Lf0IjHAPaCa7jiC+JFGf2S6oFUDe/H6lNwYCFTmcyaHo0CLl+tKfsuxoFxaeNFivD2YNCrpDcFwf0zXympLEtA==","shasum":"8851e4a5ab45e40e17cfdefd0b61cdfb80592dbd","tarball":"https://registry.npmjs.org/@dreamed-atlas/tor-downloader/-/tor-downloader-1.0.0.tgz","fileCount":27,"unpackedSize":38395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguo0PCRA9TVsSAnZWagAA+AkP/1S654mvFQfrYywFaV1g\nQCi802Y3V8RVacUvGwtUkUCji5HtBWb+fvSs1UHKpu97MRYPOacMfNVBaRcC\nIv/RLIFat3pFWZgoce3ZsBHrmRRBGC81GTDZ4FrgoUzTzhPr88FE9Vdt2X3D\nST3ksg2dhZuPm6bXv2wKtOKuhq5bp3wkRwqSlEINAWeGznXcxxV7uKSFRrqE\nAhkiD64DTD88Ak/iXQhN3JifqXwuQr+ZoW2H1FDWUEERHqjmfk/w3w5OHmdv\nc4j+HHY2CHjljGZPCm+6mgMQpqRXdp5lOLEUusVDaNR1JiGaaim3L03GaQV6\nWHo/uAgurvSWs8Jiq+wjtq1XFDdlioYW+jfwIGAlfDWtY+FFxtDUinTVrshH\n4HSfC7TF9yNuHtAKnfBKkMa6hXFy9HohXwCjCQeOv13quk1NcNycAqzKsX2n\noVl246JyeNBPcxBQAEH/+eaAJd7H/w557ISRhp0Mv2uk+oNezaNcYv8n5U96\nxXchVBo30U49OlGh2eQMfdXkeRa4ueQlPJGH8zxZhf8Wdl8bvy3mLMGIo5Xu\nv4+tpU+Z0GttnpdIkaDNR2uUvoeBcaamXe00dDc9Zp6MQ2gMkmX9I2lI7seo\nUhMxLACQzvMXTIKAXT0OZe0sekD04EVb2wbXYk1Lkig/fTGdNtIVCyDU39w2\nan2I\r\n=k9kv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgW+Vuus3HdENhQ0yelLUl4sxdjjsFrKPRam92Q1OfGAiBsowN6XZ2ubvHaCQ/k6TpBnRk10ej6BbeFdSEkNbbtSg=="}]},"_npmUser":{"name":"gta-cool","email":"gtacool73@gmail.com"},"directories":{},"maintainers":[{"name":"gta-cool","email":"gtacool73@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tor-downloader_1.0.0_1622838542952_0.7619772750565856"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-04T20:29:02.586Z","1.0.0":"2021-06-04T20:29:03.061Z","modified":"2022-04-05T05:37:31.620Z"},"maintainers":[{"name":"gta-cool","email":"gtacool73@gmail.com"}],"description":"A NodeJS library to download Tor binary for several platforms and architectures","homepage":"https://github.com/DreamedAtlas/tor-downloader","keywords":["tor","binary","downloader","dreamed-atlas"],"repository":{"type":"git","url":"git+https://github.com/DreamedAtlas/tor-downloader.git"},"author":{"name":"Dreamed Atlas","url":"https://github.com/DreamedAtlas"},"bugs":{"url":"https://github.com/DreamedAtlas/tor-downloader/issues"},"license":"MIT","readme":"# Tor Downloader\n\nA NodeJS library to download Tor binary for several platforms and architectures.\n\nTo do so, this library downloads TorBrowser and extracts Tor from its archive.\n\n## Version Support\n\n- Node.js >= 10.12.0\n\n## Getting Started\n\n```sh\n# Install Tor Downloader\n\n# NPM\nnpm install @dreamed-atlas/tor-downloader --save\n\n# Yarn\nyarn add @dreamed-atlas/tor-downloader\n```\n\n### Retrieve Tor for the current platform\n\n```js\nconst { join } = require(\"path\");\nconst { tmpdir } = require(\"os\");\nconst { spawn } = require(\"child_process\");\nconst { TorDownloader } = require(\"@dreamed-atlas/tor-downloader\");\n\n(async () => {\n    // Directory where Tor will be retrieved\n    const torPath = join(tmpdir(), \"Tor\");\n\n    const torDownloader = new TorDownloader();\n\n    // Retrieve Tor to torPath\n    await torDownloader.retrieve(torPath);\n\n    // Add execution rights to the Tor binary file\n    await torDownloader.addExecutionRigthsOnTorBinaryFile(torPath);\n\n    const torBinaryPath = join(torPath, torDownloader.getTorBinaryFilename());\n\n    // Spawn a Tor process\n    await new Promise((resolve, reject) => {\n        const torProcess = spawn(torBinaryPath);\n        torProcess.on(\"error\", reject);\n        torProcess.on(\"exit\", (code) => resolve(code));\n        torProcess.stderr.on(\"data\", (chunk) => console.error(String(chunk)));\n        torProcess.stdout.on(\"data\", (chunk) => console.log(String(chunk)));\n    });\n})();\n```\n\n### Retrieve Tor for a different platform\n\n```js\nconst { join } = require(\"path\");\nconst { tmpdir } = require(\"os\");\nconst {\n    TorDownloader,\n    TorBrowserRelease,\n    TorBrowserBranch,\n} = require(\"@dreamed-atlas/tor-downloader\");\n\n(async () => {\n    // Directory where Tor will be retrieved\n    const torPath = join(tmpdir(), \"Tor\");\n\n    // Target a specific TorBrowser release\n    const torBrowserRelease = await TorBrowserRelease.fromBranch(\n        TorBrowserBranch.STABLE,\n        \"linux\",\n        \"ia32\",\n    );\n\n    const torDownloader = new TorDownloader();\n\n    // Retrieve Tor to torPath\n    await torDownloader.retrieve(torPath, torBrowserRelease);\n\n    // Add execution rights to the Tor binary file\n    await torDownloader.addExecutionRigthsOnTorBinaryFile(torPath);\n\n    // Get path to the tor binary file\n    const torBinaryPath = join(torPath, torDownloader.getTorBinaryFilename());\n})();\n```\n\n### Using Tor alpha\n\n```js\nconst {\n    TorDownloader,\n    TorBrowserRelease,\n    TorBrowserBranch,\n} = require(\"@dreamed-atlas/tor-downloader\");\n\n(async () => {\n    const torDownloader = new TorDownloader();\n\n    // Target branch alpha\n    const torBrowserRelease = await TorBrowserRelease.fromBranch(\n        TorBrowserBranch.ALPHA,\n    );\n\n    // Retrieve Tor to torPath\n    await torDownloader.retrieve(torPath, torBrowserRelease);\n})();\n```\n\n### Tor mirroirs / You cannot use HTTPS\n\nIf you want to use a [Tor mirroir](https://2019.www.torproject.org/getinvolved/mirrors.html.en) closer to your location or you're in one of the many places in the world where you can't use HTTPS:\n\n```js\nconst { TorDownloader, TorBrowserRepository } = require(\"@dreamed-atlas/tor-downloader\");\n\n(async () => {\n    const torBrowserRepository = new TorBrowserRepository(\n        \"http://tor.dreamed-atlas.uk/dist/torbrowser/\",\n    );\n\n    const torDownloader = new TorDownloader(torBrowserRepository);\n\n    // Retrieve Tor to torPath\n    await torDownloader.retrieve(torPath);\n})();\n```\n\nYou can find an officiel list of Tor mirroirs here: https://2019.www.torproject.org/getinvolved/mirrors.html.en.\n","readmeFilename":"README.md"}