{"id":16641987,"url":"https://github.com/artskydj/mock-webtorrent","last_synced_at":"2026-04-28T04:34:22.056Z","repository":{"id":31402154,"uuid":"34965390","full_name":"ArtskydJ/mock-webtorrent","owner":"ArtskydJ","description":"A mock of feross/webtorrent, for testing purposes.","archived":false,"fork":false,"pushed_at":"2015-05-02T22:51:04.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-20T15:48:06.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtskydJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-02T22:25:21.000Z","updated_at":"2016-01-02T17:24:20.000Z","dependencies_parsed_at":"2022-08-26T18:21:55.316Z","dependency_job_id":null,"html_url":"https://github.com/ArtskydJ/mock-webtorrent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fmock-webtorrent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fmock-webtorrent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fmock-webtorrent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtskydJ%2Fmock-webtorrent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtskydJ","download_url":"https://codeload.github.com/ArtskydJ/mock-webtorrent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165135,"owners_count":20246720,"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":[],"created_at":"2024-10-12T07:48:30.298Z","updated_at":"2025-12-27T07:35:12.850Z","avatar_url":"https://github.com/ArtskydJ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"mock-webtorrent\r\n===============\r\n\r\nUse like you would use feross/webtorrent.\r\n\r\n# example\r\n\r\n### what you would do with actual webtorrent\r\n\r\n```js\r\nvar WebTorrent = require('webtorrent')\r\nvar client1 = new WebTorrent()\r\nvar client2 = new WebTorrent() // Note this line...\r\n\r\nclient1.seed(...)\r\nclient2.download(...)\r\n```\r\n\r\n### what you do with this mock\r\n\r\n```js\r\nvar WebTorrent = require('mock-webtorrent')\r\nvar client1 = new WebTorrent()\r\nvar client2 = client1 // Note this line...\r\n\r\nclient1.seed(...)\r\nclient2.download(...)\r\n```\r\n\r\n# api\r\n\r\n### `client.destroy()`\r\n\r\n### `client.remove(infoHash)`\r\n\r\n- `infoHash` is a string, e.g. `'01a6faadd5d05e3af27dff2424e0a99bdeb825fc'`\r\n\r\n### `client.seed(files, cb(torrent))`\r\n\r\n- `files` is an array of filename strings, e.g. `[ 'file1.txt', 'awesome.avi' ]`\r\n- `cb` is a callback function that has the argument `torrent`\r\n\r\n### `client.add(infoHash, [config,] cb(torrent))`\r\n### `client.download(infoHash, [config,] cb(torrent))`\r\n\r\n- `infoHash` is a string, e.g. `'01a6faadd5d05e3af27dff2424e0a99bdeb825fc'`\r\n- `config` is an optional object that doesn't do anything in this mock\r\n- `cb` is a callback function that has the argument `torrent`\r\n\r\n### `torrent`\r\n\r\n- `torrent.infoHash`\r\n- `torrent.files`\r\n\r\n### `file`\r\n\r\n- `name` is a string of the filename, e.g. `'awesome.avi'`\r\n- `getBlobURL()` is a function that returns a string of the blob URL\r\n- `createReadStream()` is a function that returns a read stream of the file\r\n\r\n# install\r\n\r\nWith [npm](http://nodejs.org/download) do:\r\n\r\n\tnpm install mock-webtorrent\r\n\r\n# todo\r\n\r\n- tests\r\n- travis-ci\r\n- implement more of the webtorrent api, as needed\r\n\r\n# license\r\n\r\n[VOL](http://veryopenlicense.com)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fmock-webtorrent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartskydj%2Fmock-webtorrent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartskydj%2Fmock-webtorrent/lists"}