JSPM

  • Created
  • Published
  • Downloads 695
  • Score
    100M100P100Q96546F
  • License ISC

Find duplicate files in multiple folders scanning .txt and .torrent files.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (twin-scanner-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Twin scanner CLI

    DescriptionTechnical StackFeaturesDX featuresDocumentationPre-requisitesQuick startMiscellaneous

    Description

    • Find duplicate files in multiple folder(s) scanning .txt or/and .torrent files and depending on the selected mode (readonly: true | false) get information about duplicated files /+ extract them into new folders.

    Technical Stack

    • fp-ts
    • inquirer
    • inquirer-autocomplete-standalone
    • inquirer-fuzzy-path
    • zod

    Features

    • Nested scanning in one/multi folders to get info about files
    • Interactive CLI with step-by-step configuration and autocomplete for path selection
    • Supporting only .txt, .torrent file scanning or both formats simultaneously to find duplicates between multiple folders
    • Supporting readonly mode for casual listing info about duplicates without extraction them
    • Supporting of removing duplicates not only between cross folders, but into the same folder as well f.e:
      1. For .torrent files: [ "cat.torrent", "cat (1).torrent", "cat (19).torrent"] => ["cat.torrent"]
      2. For .txt files: remove equal and duplicate (by analogy with torrent file names logic) lines from .txt file
    • Supporting opportunity to define own custom mapper between torrent file name ([rutracker.org].3021606.torrent) and URL to torrent file locating in some txt file (https://rutracker.org/forum/viewtopic.php?t=3021606)

    DX features

    Documentation

    Example of manual configuration

    • Setting VITE_APP_TORRENT_URL=https://rutracker.org/forum/viewtopic.php means that:

      • line in txt file https://rutracker.org/forum/viewtopic.php?t=3021606 and torrent file [rutracker.org].3021606.torrent will be considered the same during deduplication process
    • For overriding default mapper between torrent file and URL to torrent file, change extractTorrentFileNameFromURL, convertTorrentFilenameToURL functions and rebuild app.

    Demo

    On the image is described file structure before and after applying CLI:

    Demo

    Graph dependencies

    • Top-level
      • SVG
    • All code
      • All code

    Pre-requisites

    • Linux-based OS
    • Node.js (checked on v20.15.1)
    • pnpm

    Quick start

    1. Clone actual version of app
    git clone --depth 1 https://github.com/Skippia/twin-scanner-cli.git
    1. Install dependencies
    cd ./twin-scanner-cli && pnpm i
    1. Set env (url) for mapping between torrent name and torrent URL in txt files
    Rename .env.example -> .env and update variables
    1. Build and run
    npm run build && npm run start:prod