{"_id":"@acancescu/qbittorrent","name":"@acancescu/qbittorrent","dist-tags":{"latest":"9.9.0"},"versions":{"9.9.0":{"name":"@acancescu/qbittorrent","version":"9.9.0","description":"TypeScript api wrapper for qbittorrent using ofetch","author":{"name":"Scott Cooper","email":"scttcper@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alexandrucancescu/qbittorrent.git"},"homepage":"https://qbittorrent.vercel.app","type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","sideEffects":false,"keywords":["typescript","qbittorrent"],"dependencies":{"@ctrl/magnet-link":"^4.2.0","@ctrl/shared-torrent":"^6.5.0","@ctrl/torrent-file":"^4.2.0","cookie":"^1.0.2","node-fetch-native":"^1.6.7","ofetch":"^1.4.1","parse-torrent":"^11.0.18","type-fest":"^5.0.1","ufo":"^1.6.1","uint8array-extras":"^1.5.0"},"devDependencies":{"@ctrl/oxlint-config":"1.2.6","@sindresorhus/tsconfig":"8.0.1","@trivago/prettier-plugin-sort-imports":"5.2.2","@types/node":"24.6.1","@types/parse-torrent":"^5.8.7","@vitest/coverage-v8":"3.2.4","oxlint":"1.19.0","p-wait-for":"6.0.0","prettier":"3.6.2","typedoc":"0.28.13","typescript":"5.9.3","vitest":"3.2.4"},"release":{"branches":["master"]},"engines":{"node":">=18"},"prettier":{"singleQuote":true,"trailingComma":"all","arrowParens":"avoid","semi":true,"printWidth":100,"plugins":["@trivago/prettier-plugin-sort-imports"],"importOrder":["^node:.*$","<THIRD_PARTY_MODULES>","^(@ctrl)(/.*|$)","^\\.\\./(?!.*\\.css$)","^\\./(?!.*\\.css$)(?=.*/)","^\\./(?!.*\\.css$)(?!.*/)"],"importOrderSeparation":true,"importOrderSortSpecifiers":false},"scripts":{"lint":"oxlint . && prettier --check . --experimental-cli","lint:fix":"oxlint . --fix && prettier --write . --log-level=error --experimental-cli","build":"tsc","build:docs":"typedoc","test":"vitest run","test:watch":"vitest","test:ci":"vitest run --coverage --reporter=default --reporter=junit --outputFile=./junit.xml"},"_id":"@acancescu/qbittorrent@9.9.0","bugs":{"url":"https://github.com/alexandrucancescu/qbittorrent/issues"},"_integrity":"sha512-OTY2KzhrPOkq2wcgOyrPshjMvdUBy7H1r5D6yV43VIRX1of885jXk9Milz5z4s0vNyuvaauAYQ8alPqpUWEu+Q==","_resolved":"/private/var/folders/db/ffy2p3tx7klgztlq52ns8ql80000gn/T/f54d6288e65abb5e5e6c26de88d0897c/acancescu-qbittorrent-9.9.0.tgz","_from":"file:acancescu-qbittorrent-9.9.0.tgz","_nodeVersion":"23.6.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-OTY2KzhrPOkq2wcgOyrPshjMvdUBy7H1r5D6yV43VIRX1of885jXk9Milz5z4s0vNyuvaauAYQ8alPqpUWEu+Q==","shasum":"91454e758cd70504f72859622718829176b4d71c","tarball":"https://registry.npmjs.org/@acancescu/qbittorrent/-/qbittorrent-9.9.0.tgz","fileCount":11,"unpackedSize":88114,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCPgASFDrNoPo2o1EGfFxZtIw73JKk9hzy5CiUId1mLQQIhAJx4UpHX6nWk9IF3GQtk6Ng3mlyX64tHO9fzsZKo7I+u"}]},"_npmUser":{"name":"alexandrucancescu","email":"anduhd@gmail.com"},"directories":{},"maintainers":[{"name":"alexandrucancescu","email":"anduhd@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/qbittorrent_9.9.0_1759441470114_0.04766335417618239"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-02T21:44:30.007Z","9.9.0":"2025-10-02T21:44:30.304Z","modified":"2025-10-02T21:44:30.622Z"},"maintainers":[{"name":"alexandrucancescu","email":"anduhd@gmail.com"}],"description":"TypeScript api wrapper for qbittorrent using ofetch","homepage":"https://qbittorrent.vercel.app","keywords":["typescript","qbittorrent"],"repository":{"type":"git","url":"git+https://github.com/alexandrucancescu/qbittorrent.git"},"author":{"name":"Scott Cooper","email":"scttcper@gmail.com"},"bugs":{"url":"https://github.com/alexandrucancescu/qbittorrent/issues"},"license":"MIT","readme":"# qBittorrent [![npm](https://badgen.net/npm/v/@ctrl/qbittorrent)](https://www.npmjs.com/package/@ctrl/qbittorrent) [![coverage](https://badgen.net/codecov/c/github/scttcper/qbittorrent)](https://codecov.io/gh/scttcper/qbittorrent)\n\n> TypeScript api wrapper for [qBittorrent](https://www.qbittorrent.org/) using [ofetch](https://github.com/unjs/ofetch)\n\n### Install\n\n```console\nnpm install @ctrl/qbittorrent\n```\n\n### Use\n\n```ts\nimport { QBittorrent } from '@ctrl/qbittorrent';\n\nconst client = new QBittorrent({\n  baseUrl: 'http://localhost:8080/',\n  username: 'admin',\n  password: 'adminadmin',\n});\n\nasync function main() {\n  const res = await client.getAllData();\n  console.log(res);\n}\n```\n\n### API\n\nDocs: https://qbittorrent.vercel.app  \nqBittorrent Api Docs: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)\n\n### Normalized API\n\nThese functions have been normalized between torrent clients to easily support switching between multiple torrent clients. See [below](#see-also) for alternative supported torrent clients\n\n##### getAllData\n\nReturns all torrent data and an array of label objects. Data has been normalized and does not match the output of native `listTorrents()`.\n\n```ts\nconst data = await client.getAllData();\nconsole.log(data.torrents);\n```\n\n##### getTorrent\n\nReturns one torrent data from torrent hash\n\n```ts\nconst data = await client.getTorrent('torrent-hash');\nconsole.log(data);\n```\n\n##### pauseTorrent and resumeTorrent\n\nPause or resume a torrent\n\n```ts\nconst paused = await client.pauseTorrent();\nconsole.log(paused);\nconst resumed = await client.resumeTorrent();\nconsole.log(resumed);\n```\n\n##### removeTorrent\n\nRemove a torrent. Does not remove data on disk by default.\n\n```ts\n// does not remove data on disk\nconst result = await client.removeTorrent('torrent_id', false);\nconsole.log(result);\n\n// remove data on disk\nconst res = await client.removeTorrent('torrent_id', true);\nconsole.log(res);\n```\n\n##### addTorrent\n\nAdd a torrent, has client specific options. Also see normalizedAddTorrent\n\n```ts\nconst result = await client.addTorrent(fs.readFileSync(torrentFile));\nconsole.log(result);\n```\n\n##### normalizedAddTorrent\n\nAdd a torrent and return normalized torrent data, can start a torrent paused and add label\n\n```ts\nconst result = await client.normalizedAddTorrent(fs.readFileSync(torrentFile), {\n    startPaused: false;\n    label: 'linux';\n});\nconsole.log(result);\n```\n\n##### export and create from state\n\nIf you're shutting down the server often (serverless?) you can export the state\n\n```ts\nconst state = client.exportState();\nconst client = QBittorrent.createFromState(config, state);\n```\n\n### See Also\n\nAll of the following npm modules provide the same normalized functions along with supporting the unique apis for each client.\n\ndeluge - https://github.com/scttcper/deluge  \ntransmission - https://github.com/scttcper/transmission  \nutorrent - https://github.com/scttcper/utorrent\n\n### Start a test docker container\n\n```\ndocker run -d \\\n  --name=qbittorrent \\\n  -e PUID=1000 \\\n  -e PGID=1000 \\\n  -e TZ=Etc/UTC \\\n  -e WEBUI_PORT=8080 \\\n  -p 8080:8080 \\\n  -p 6881:6881 \\\n  -p 6881:6881/udp \\\n  --restart unless-stopped \\\n  lscr.io/linuxserver/qbittorrent:latest\n```\n","readmeFilename":"README.md","_rev":"1-4e32c505a1e04288b545f805c65006e7"}