magnet-uri
Advanced tools
Comparing version 5.2.0 to 5.2.1
{ | ||
"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', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9990
0