Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

magnet-uri

Package Overview
Dependencies
Maintainers
8
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magnet-uri - npm Package Compare versions

Comparing version 5.2.0 to 5.2.1

2

package.json
{
"name": "magnet-uri",
"description": "Parse a magnet URI and return an object of keys/values",
"version": "5.2.0",
"version": "5.2.1",
"author": {

@@ -6,0 +6,0 @@ "name": "WebTorrent, LLC",

@@ -31,8 +31,8 @@ # magnet-uri [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

```js
var magnet = require('magnet-uri')
const magnet = require('magnet-uri')
// "Leaves of Grass" by Walt Whitman
var uri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=udp%3A%2F%2Ftracker.example4.com%3A80&tr=udp%3A%2F%2Ftracker.example5.com%3A80&tr=udp%3A%2F%2Ftracker.example3.com%3A6969&tr=udp%3A%2F%2Ftracker.example2.com%3A80&tr=udp%3A%2F%2Ftracker.example1.com%3A1337'
const uri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=udp%3A%2F%2Ftracker.example4.com%3A80&tr=udp%3A%2F%2Ftracker.example5.com%3A80&tr=udp%3A%2F%2Ftracker.example3.com%3A6969&tr=udp%3A%2F%2Ftracker.example2.com%3A80&tr=udp%3A%2F%2Ftracker.example1.com%3A1337'
var parsed = magnet.decode(uri)
const parsed = magnet.decode(uri)
console.log(parsed.dn) // "Leaves of Grass by Walt Whitman.epub"

@@ -76,5 +76,5 @@ console.log(parsed.infoHash) // "d2474e86c95b19b8bcfdb92bc12c9d44667cfa36"

```js
var magnet = require('magnet-uri')
const magnet = require('magnet-uri')
var uri = magnet.encode({
const uri = magnet.encode({
xt: [

@@ -81,0 +81,0 @@ 'urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc