[
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: ci\n\non: [push, pull_request]\n\njobs:\n  test:\n    name: Node ${{ matrix.node }} / ${{ matrix.os }}\n    runs-on: ${{ matrix.os }}\n    strategy:\n      fail-fast: false\n      matrix:\n        os:\n          - ubuntu-latest\n        node:\n          - '16'\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: ${{ matrix.node }}\n      - run: npm install\n      - run: npm run build --if-present\n      - run: npm test\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          persist-credentials: false\n      - name: Setup Node.js\n        uses: actions/setup-node@v3\n        with:\n          node-version: 18\n      - name: Cache\n        uses: actions/cache@v3\n        with:\n          path: ~/.npm\n          key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}\n          restore-keys: |\n            ${{ runner.os }}-npm-\n      - name: Install dependencies\n        env:\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n        run: npm i\n      - name: Release\n        env:\n          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n        run: npx semantic-release\n"
  },
  {
    "path": ".github/workflows/stale.yml",
    "content": "name: Mark stale issues and pull requests\n\non:\n  schedule:\n  - cron: '0 12 * * *'\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n      pull-requests: write\n\n    steps:\n    - uses: actions/stale@v8\n      with:\n        repo-token: ${{ secrets.GITHUB_TOKEN }}\n        stale-issue-message: 'Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?'\n        stale-pr-message: 'Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?'\n        exempt-issue-labels: accepted,blocked,bug,security,meta\n        exempt-pr-labels: accepted,blocked,bug,'help wanted',security,meta\n        stale-issue-label: 'stale'\n        stale-pr-label: 'stale'\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules/\npackage-lock.json\n"
  },
  {
    "path": ".npmignore",
    "content": "examples/\n.github/\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# [6.0.0](https://github.com/webtorrent/webtorrent-hybrid/compare/v5.0.2...v6.0.0) (2024-06-02)\n\n\n* BREAKING CHANGE: Deprecate webtorrent-hybrid (#195) ([fe511bf](https://github.com/webtorrent/webtorrent-hybrid/commit/fe511bf98a109b5bc7967a2853345a0b23da7b11)), closes [#195](https://github.com/webtorrent/webtorrent-hybrid/issues/195)\n\n\n### BREAKING CHANGES\n\n* Deprecate webtorrent-hybrid\n\nThis package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \"webtorrent\" package.\n\n* fix: Update ci to use NodeJS 16 to match package.json\n\n* Update README.md\n\nUpdate `Deprecated Warning` to `Deprecation Warning`\n\nCo-authored-by: Cas_ <6506529+ThaUnknown@users.noreply.github.com>\n\n* fix: re-add WEBTORRENT_ANNOUNCE which is used for adding websocket trackers to magnetURIs which do not already have them.\n\n* feat: update webtorrent-cli to v5\n\n## [5.0.2](https://github.com/webtorrent/webtorrent-hybrid/compare/v5.0.1...v5.0.2) (2022-02-01)\n\n\n### Bug Fixes\n\n* **deps:** update dependency webtorrent-cli to v4 ([#145](https://github.com/webtorrent/webtorrent-hybrid/issues/145)) ([7da7ddf](https://github.com/webtorrent/webtorrent-hybrid/commit/7da7ddfcb1f163b331f248395319e5fd8ff48752))\n\n## [5.0.1](https://github.com/webtorrent/webtorrent-hybrid/compare/v5.0.0...v5.0.1) (2021-09-14)\n\n\n### Bug Fixes\n\n* webrtc import ([#143](https://github.com/webtorrent/webtorrent-hybrid/issues/143)) ([3b5d9bb](https://github.com/webtorrent/webtorrent-hybrid/commit/3b5d9bb0a21fceef76f25a113ebede40fce73338))\n\n# [5.0.0](https://github.com/webtorrent/webtorrent-hybrid/compare/v4.1.3...v5.0.0) (2021-08-26)\n\n\n### chore\n\n* switch to ESM ([#141](https://github.com/webtorrent/webtorrent-hybrid/issues/141)) ([cbe8c3b](https://github.com/webtorrent/webtorrent-hybrid/commit/cbe8c3b8fff52a6fe9c86e531967566c5a889b12))\n\n\n### BREAKING CHANGES\n\n* switch to ESM\n\n## [4.1.3](https://github.com/webtorrent/webtorrent-hybrid/compare/v4.1.2...v4.1.3) (2021-08-18)\n\n\n### Bug Fixes\n\n* dockerfile missing dependency ([#137](https://github.com/webtorrent/webtorrent-hybrid/issues/137)) ([2523b48](https://github.com/webtorrent/webtorrent-hybrid/commit/2523b48e1efd580139f27951edb130f96111d8a0))\n\n## [4.1.2](https://github.com/webtorrent/webtorrent-hybrid/compare/v4.1.1...v4.1.2) (2021-08-06)\n\n\n### Bug Fixes\n\n* **deps:** update dependency create-torrent to v5 ([#134](https://github.com/webtorrent/webtorrent-hybrid/issues/134)) ([012f3fd](https://github.com/webtorrent/webtorrent-hybrid/commit/012f3fd702f6cfd70bb6cc29762412f78010daf7))\n\n## [4.1.1](https://github.com/webtorrent/webtorrent-hybrid/compare/v4.1.0...v4.1.1) (2021-07-23)\n\n\n### Bug Fixes\n\n* add semantic release, switch CI ([f48c8ca](https://github.com/webtorrent/webtorrent-hybrid/commit/f48c8ca1ae4daa7ebdf5f86e2a59ba29ee3c05e6))\n\n# [4.1.0](https://github.com/webtorrent/webtorrent-hybrid/compare/v4.0.3...v4.1.0) (2021-05-31)\n\n\n### Features\n\n* renovate and semantic-release, webtorrent@1 ([f175996](https://github.com/webtorrent/webtorrent-hybrid/commit/f175996e4528d57f4c762046291eaf19aee29965))\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM node:slim\n\nRUN apt-get update && \\\n\tapt-get full-upgrade -y && \\\n\tapt-get install -y libgtk2.0-0 libgconf-2-4 libasound2 libxtst6 libxss1 libnss3 xvfb git -y && \\\n\tapt-get autoremove --purge -y && \\\n\trm -rf /var/lib/apt/lists/* && \\\n\tnpm i -g node-pre-gyp\n\nRUN npm i -g webtorrent-hybrid && \\\n\tmkdir -p /webtorrent\n\nEXPOSE 8000\nWORKDIR /webtorrent\nENTRYPOINT [\"/usr/local/bin/webtorrent-hybrid\"]\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) Feross Aboukhadijeh and WebTorrent, LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Deprecation Warning\nThis package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \"webtorrent\" package.\n\n# webtorrent-hybrid [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[ci-image]: https://github.com/webtorrent/webtorrent-hybrid/actions/workflows/ci.yml/badge.svg\n[ci-url]: https://github.com/webtorrent/webtorrent-hybrid/actions/workflows/ci.yml\n[npm-image]: https://img.shields.io/npm/v/webtorrent-hybrid.svg\n[npm-url]: https://npmjs.org/package/webtorrent-hybrid\n[downloads-image]: https://img.shields.io/npm/dm/webtorrent-hybrid.svg\n[downloads-url]: https://npmjs.org/package/webtorrent-hybrid\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n### Streaming torrent client (with WebRTC support in Node.js)\n\nIn node.js, the `webtorrent` package only connects to normal TCP/UDP peers, not WebRTC peers. If you want to connect to all types of peers, including WebRTC peers, from node.js, you need to use this package (`webtorrent-hybrid`).\n\n## Install\n\nTo install WebTorrent:\n\n```bash\nnpm install webtorrent-hybrid\n```\n\nTo install a `webtorrent-hybrid` command line program, run:\n\n```bash\nnpm install webtorrent-hybrid -g\n```\n\n## Usage\n\n`webtorrent-hybrid` has the same command line interface (CLI) and module API as\n[`webtorrent`](https://github.com/webtorrent/webtorrent). Just `import WebTorrent from 'webtorrent-hybrid'`\ninstead of `import WebTorrent from 'webtorrent'`.\n\nSee the [WebTorrent docs](https://webtorrent.io/docs).\n\n## License\n\nMIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org) and [WebTorrent, LLC](https://webtorrent.io).\n"
  },
  {
    "path": "bin/cmd.js",
    "content": "#!/usr/bin/env node\n\nimport '../lib/global.js'\nimport 'webtorrent-cli/bin/cmd.js'\n"
  },
  {
    "path": "examples/node-download.js",
    "content": "import WebTorrent from '../index.js'\nimport fs from 'fs'\n\nconst client = new WebTorrent()\n\nconst torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d'\n\nconsole.log('torrentId:\\t', torrentId)\n\nclient.add(torrentId, torrent => {\n  const files = torrent.files\n  let length = files.length\n  // Stream each file to the disk\n  files.forEach(file => {\n    const source = file.createReadStream()\n    const destination = fs.createWriteStream(file.name)\n    source.on('end', () => {\n      console.log('file:\\t\\t', file.name)\n      // close after all files are saved\n      length -= 1\n      if (!length) process.exit()\n    }).pipe(destination)\n  })\n})\n"
  },
  {
    "path": "examples/node-seed.js",
    "content": "import WebTorrent from '../index.js'\n\nconst client = new WebTorrent()\nconst filePath = __filename\n\nconsole.log('filePath:', filePath)\n\nclient.seed(filePath, torrent => {\n  console.log('torrentId (info hash):', torrent.infoHash)\n  // console.log('torrentId (magnet link):', torrent.magnetURI)\n})\n"
  },
  {
    "path": "index.js",
    "content": "/*! webtorrent-hybrid. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */\nimport './lib/global.js'\nexport { default } from 'webtorrent'\n"
  },
  {
    "path": "lib/global.js",
    "content": "import { announceList } from 'create-torrent'\n\nglobalThis.WEBTORRENT_ANNOUNCE = announceList\n  .map(arr => arr[0])\n  .filter(url => url.indexOf('wss://') === 0 || url.indexOf('ws://') === 0)\n\nconsole.warn('webtorrent-hybrid: This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \"webtorrent\" package.')\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"webtorrent-hybrid\",\n  \"type\": \"module\",\n  \"description\": \"Streaming torrent client\",\n  \"version\": \"6.0.0\",\n  \"author\": {\n    \"name\": \"WebTorrent LLC\",\n    \"email\": \"feross@webtorrent.io\",\n    \"url\": \"https://webtorrent.io\"\n  },\n  \"bin\": \"./bin/cmd.js\",\n  \"bugs\": {\n    \"url\": \"https://github.com/webtorrent/webtorrent-hybrid/issues\"\n  },\n  \"deprecated\": \"This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \\\"webtorrent\\\" package.\",\n  \"dependencies\": {\n    \"create-torrent\": \"^6.0.17\",\n    \"webtorrent\": \"^2.3.0\",\n    \"webtorrent-cli\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"@webtorrent/semantic-release-config\": \"1.0.11\",\n    \"semantic-release\": \"21.1.2\",\n    \"standard\": \"*\"\n  },\n  \"engines\": {\n    \"node\": \">=16\"\n  },\n  \"homepage\": \"https://webtorrent.io\",\n  \"keywords\": [\n    \"bittorrent\",\n    \"bittorrent client\",\n    \"download\",\n    \"mad science\",\n    \"streaming\",\n    \"torrent\",\n    \"webrtc\",\n    \"webrtc data\",\n    \"webtorrent\"\n  ],\n  \"license\": \"MIT\",\n  \"exports\": \"./index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/webtorrent/webtorrent-hybrid.git\"\n  },\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"funding\": [\n    {\n      \"type\": \"github\",\n      \"url\": \"https://github.com/sponsors/feross\"\n    },\n    {\n      \"type\": \"patreon\",\n      \"url\": \"https://www.patreon.com/feross\"\n    },\n    {\n      \"type\": \"consulting\",\n      \"url\": \"https://feross.org/support\"\n    }\n  ],\n  \"renovate\": {\n    \"extends\": [\n      \"github>webtorrent/renovate-config\"\n    ]\n  },\n  \"release\": {\n    \"extends\": \"@webtorrent/semantic-release-config\"\n  }\n}\n"
  }
]