Welcome to mirror list, hosted at ThFree Co, Russian Federation.

common.js « test - github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f11fcb26d10e9654c15465fcba387379ef59584f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const os = require('os')
const fs = require('fs')
const path = require('path')

exports.getDownloadPath = (infix, infoHash) => {
  let tmpPath
  try {
    tmpPath = path.join(fs.statSync('/tmp') && '/tmp')
  } catch (err) {
    tmpPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/')
  }
  return path.join(tmpPath, 'webtorrent', 'test', infix, infoHash)
}