Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honzahommer/node-torrent2magnet
Create a magnet URI from a torrent file
https://github.com/honzahommer/node-torrent2magnet
Last synced: about 2 months ago
JSON representation
Create a magnet URI from a torrent file
- Host: GitHub
- URL: https://github.com/honzahommer/node-torrent2magnet
- Owner: honzahommer
- License: mit
- Created: 2019-04-20T17:22:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:31:12.000Z (almost 2 years ago)
- Last Synced: 2024-04-25T11:41:36.876Z (8 months ago)
- Language: JavaScript
- Size: 346 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# torrent2magnet
[![npm Package](https://img.shields.io/npm/v/torrent2magnet.svg)](https://www.npmjs.org/package/torrent2magnet)
[![License](https://img.shields.io/npm/l/torrent2magnet.svg)](https://github.com/honzahommer/node-torrent2magnet/blob/master/LICENSE)
[![build status](https://img.shields.io/travis/honzahommer/node-torrent2magnet/master.svg)](http://travis-ci.org/honzahommer/node-torrent2magnet)
[![downloads per month](http://img.shields.io/npm/dm/torrent2magnet.svg)](https://www.npmjs.org/package/torrent2magnet)
[![Greenkeeper badge](https://badges.greenkeeper.io/honzahommer/node-torrent2magnet.svg)](https://greenkeeper.io/)> Takes a torrent file and returns it's magnet uri.
## Install
Install via
`npm install torrent2magnet`## Usage
```js
const torrent2magnet = require('torrent2magnet');# Async
torrent2magnet(torrentUrl, options, (err, uri) => {
if (err) {
return console.error(err);
}console.log(uri);
});# Promise
torrent2magnet(torrentUrl, options).then(uri => {
console.log(uri);
}).catch(err => {
console.error(err);
});# Sync
try {
console.log(torrent2magnet(torrentUrl));
} catch (err) {
console.log(err);
}
```## License
MIT
*Fork of [apsdehal/torrent-to-magnet](https://github.com/apsdehal/torrent-to-magnet).*