Socket
Socket
Sign inDemoInstall

create-torrent

Package Overview
Dependencies
Maintainers
8
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-torrent - npm Package Compare versions

Comparing version 4.4.5 to 4.5.0

35

index.js

@@ -121,10 +121,12 @@ /*! create-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */

// remove junk files
input = input.filter(item => {
if (typeof item === 'string') {
return true
}
const filename = item.path[item.path.length - 1]
return notHidden(filename) && junk.not(filename)
})
const filterJunkFiles = opts.filterJunkFiles === undefined ? true : opts.filterJunkFiles
if (filterJunkFiles) {
// Remove junk files
input = input.filter(item => {
if (typeof item === 'string') {
return true
}
return !isJunkPath(item.path)
})
}

@@ -213,6 +215,2 @@ if (commonPrefix) {

function notHidden (file) {
return file[0] !== '.'
}
function getPieceList (files, pieceLength, cb) {

@@ -356,2 +354,14 @@ cb = once(cb)

/**
* Determine if a a file is junk based on its path
* (defined as hidden OR recognized by the `junk` package)
*
* @param {string} path
* @return {boolean}
*/
function isJunkPath (path) {
const filename = path[path.length - 1]
return filename[0] === '.' && junk.is(filename)
}
/**
* Accumulator to sum file lengths

@@ -439,1 +449,2 @@ * @param {number} sum

module.exports.announceList = announceList
module.exports.isJunkPath = isJunkPath
{
"name": "create-torrent",
"description": "Create .torrent files",
"version": "4.4.5",
"version": "4.5.0",
"author": {

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

@@ -68,2 +68,3 @@ # create-torrent [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

creationDate: Date // creation time in UNIX epoch format (default = now)
filterJunkFiles: Boolean, // remove hidden and other junk files? (default = true)
private: Boolean, // is this a private .torrent? (default = false)

@@ -70,0 +71,0 @@ pieceLength: Number, // force a custom piece length (number of bytes)

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