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: 691d1785871e27db2883acabb3a1ba6dc6e30791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var fs = require('fs')
var path = require('path')
var parseTorrent = require('parse-torrent')

var content = path.join(__dirname, 'content')
var torrents = path.join(__dirname, 'torrents')

module.exports = {
  // Leaves of Grass by Walt Whitman.epub
  leaves: {
    contentPath: path.join(content, 'Leaves of Grass by Walt Whitman.epub'),
    torrentPath: path.join(torrents, 'leaves.torrent'),
    content: fs.readFileSync(
      path.join(content, 'Leaves of Grass by Walt Whitman.epub')
    ),
    torrent: fs.readFileSync(path.join(torrents, 'leaves.torrent')),
    parsedTorrent: parseTorrent(
      fs.readFileSync(path.join(torrents, 'leaves.torrent'))
    ),
    magnetURI: parseTorrent.toMagnetURI(
      parseTorrent(fs.readFileSync(path.join(torrents, 'leaves.torrent')))
    )
  },

  // Folder which contains single file
  folder: {
    contentPath: path.join(content, 'folder')
  },

  // Folder which contains multiple files
  numbers: {
    contentPath: path.join(content, 'numbers')
  }
}