{"id":16974000,"url":"https://github.com/tsuk1ko/magnet2torrent-js","last_synced_at":"2025-09-17T02:32:30.230Z","repository":{"id":43115026,"uuid":"179752332","full_name":"Tsuk1ko/magnet2torrent-js","owner":"Tsuk1ko","description":"Convert magnet to torrent (independent of third-party services)","archived":true,"fork":false,"pushed_at":"2020-04-15T15:34:25.000Z","size":39,"stargazers_count":192,"open_issues_count":0,"forks_count":30,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-24T13:17:56.361Z","etag":null,"topics":["convert","magnet","torrent"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/magnet2torrent-js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tsuk1ko.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}},"created_at":"2019-04-05T20:44:51.000Z","updated_at":"2025-07-12T09:16:15.000Z","dependencies_parsed_at":"2022-09-01T14:01:00.462Z","dependency_job_id":null,"html_url":"https://github.com/Tsuk1ko/magnet2torrent-js","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Tsuk1ko/magnet2torrent-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fmagnet2torrent-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fmagnet2torrent-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fmagnet2torrent-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fmagnet2torrent-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tsuk1ko","download_url":"https://codeload.github.com/Tsuk1ko/magnet2torrent-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fmagnet2torrent-js/sbom","scorecard":{"id":144221,"data":{"date":"2025-08-11","repo":{"name":"github.com/Tsuk1ko/magnet2torrent-js","commit":"9d946872819934ef6802b6be739ee84bb7982add"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T09:01:06.493Z","repository_id":43115026,"created_at":"2025-08-16T09:01:06.493Z","updated_at":"2025-08-16T09:01:06.493Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275523104,"owners_count":25479964,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["convert","magnet","torrent"],"created_at":"2024-10-14T01:04:16.833Z","updated_at":"2025-09-17T02:32:29.955Z","avatar_url":"https://github.com/Tsuk1ko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# magnet2torrent\n\nThis module uses [torrent-stream](https://www.npmjs.com/package/torrent-stream) to download metadata of magnet links only, without creating any temp file.\n\n## Install\n\n```bash\nnpm i magnet2torrent-js\n```\n\n## API\n\n### `constructor Magnet2torrent(options?: object): Magnet2torrent`\n\nOptional options are:\n\n```javascript\n{\n    trackers: [],                  // {Array\u003cstring\u003e} Trackers to use, default is []\n    addTrackersToTorrent: false,   // {boolean} Default is false\n    timeout: 0                     // {number} Timeout seconds, set to 0 will disable it, default is 0\n}\n```\n\n### `Magnet2torrent.getTorrent(magnet: string): Promise\u003cTorrent\u003e`\n\n`magnet` can be a full BTIH magnet link or its hash only.\n\nBoth **sha-1 hash** and **base32 encoded hash** are supported.\n\nThis method will return an instance of [parse-torrent](https://www.npmjs.com/package/parse-torrent), with 2 extra functions:\n\n- `toTorrentFile()` - alias of `ParseTorrent.toTorrentFile(torrent)`\n- `toMagnetURI()` - alias of `ParseTorrent.toMagnetURI(torrent)`\n\n### `Magnet2torrent.getTorrentBuffer(magnet: string): Promise\u003cBuffer\u003e`\n\nThis method will return a buffer of torrent.\n\nIt is equal to `getTorrent(magnet).then(torrent =\u003e torrent.toTorrentFile())`.\n\n## Example\n\n### Download torrent file simply\n\n```javascript\nconst { writeFileSync } = require('fs');\nconst Magnet2torrent = require('magnet2torrent-js');\n\n// ubuntu-16.04.1-server-amd64.iso\nconst magnet = 'magnet:?xt=urn:btih:90289fd34dfc1cf8f316a268add8354c85334458';\n\nconst m2t = new Magnet2torrent({ timeout: 60 });\n\nm2t.getTorrent(magnet).then(torrent =\u003e {\n    console.log(torrent.infoHash);\n    writeFileSync(`${torrent.name}.torrent`, torrent.toTorrentFile());\n}).catch(e =\u003e {\n    // Timeout or error occured\n    console.error(e);\n});\n```\n\n### Use custom trackers and write them to torrent file\n\n```javascript\nconst { writeFileSync } = require('fs');\nconst Magnet2torrent = require('magnet2torrent-js');\n\n// https://github.com/ngosang/trackerslist\nconst trackers = [\n    'udp://tracker.coppersurfer.tk:6969/announce',\n    'udp://tracker.open-internet.nl:6969/announce',\n    'udp://tracker.leechers-paradise.org:6969/announce',\n    // ...\n];\n\n// ubuntu-16.04.1-server-amd64.iso\nconst magnet = 'magnet:?xt=urn:btih:90289fd34dfc1cf8f316a268add8354c85334458';\n\nconst m2t = new Magnet2torrent({\n    trackers,\n    addTrackersToTorrent: true\n});\n\nm2t.getTorrent(magnet).then(torrent =\u003e {\n    console.log('These trackers have been added:', torrent.announce);\n    writeFileSync(`${torrent.name}.torrent`, torrent.toTorrentFile());\n}).catch(e =\u003e {\n    // Timeout or error occured\n    console.error(e);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuk1ko%2Fmagnet2torrent-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsuk1ko%2Fmagnet2torrent-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuk1ko%2Fmagnet2torrent-js/lists"}