Library for decoding and encoding magnet links
Fast and easy to use
Written in TypeScript
Fully tested with 100% code coverage
npm install --save magnetizer
import magnetizer from 'magnetizer';
const magnetUri = magnetizer.decode(magnetLink);
import magnetizer from 'magnetizer';
const magnetLink = magnetizer.encode({
displayName: 'test-name_for_magnet-link.tar.gz',
length: 100500,
infoHashes: [ 'c12fe1c06bba254a9dc9f519b335aa7c1367a88a' ],
webSeeds: [ 'http://example.com/test-name_for_magnet-link.tar.gz' ],
acceptableSources: [ 'http://example.com/test-name_for_magnet-link.tar.gz' ],
sources: [ 'http://cache.example.com/c12fe1c06bba254a9dc9f519b335aa7c1367a88a' ],
keywords: [ 'test-name_for_magnet-link', 'tar', 'gz' ],
manifest: 'http://example.com/manifest',
trackers: [
'http://tracker.example.com/announce.php?ua=1111111111',
'wss://tracker.webtorrent.io',
],
});
npm test
This project is licensed under the MIT License - see the LICENSE file for details.