fs-indexer v0.0.7
fs-indexer
Installation
For the hashing function, you need to install b3sum
and xxh128sum
. In order
to extract exif information from images and videos, you need to install
exiftool
.
On a Mac, this can be achieved with brew install b3sum xxhash exiftool
.
Usage
$ npm install -g fs-indexer
$ fs-indexer COMMAND
running command...
$ fs-indexer (--version)
fs-indexer/0.0.7 darwin-x64 node-v17.3.0
$ fs-indexer --help [COMMAND]
USAGE
$ fs-indexer COMMAND
...
Commands
fs-indexer crawl PATH
fs-indexer help [COMMAND]
fs-indexer info
fs-indexer lookup PATH
fs-indexer verify PATH
fs-indexer crawl PATH
index the folder provided
USAGE
$ fs-indexer crawl [PATH] [-d <value>] [-a BLAKE3|XXHASH] [--exif] [-l <value>] [-m <value>] [--debug]
FLAGS
-a, --hashingAlgorithms=<option>... hashing algorithms to use
<options: BLAKE3|XXHASH>
-d, --database=<value> [default: fs-index.db] database file
-l, --limit=<value> stop after indexing n files
-m, --minutes=<value> stop after n minutes
--debug enable debug logging
--exif extract exif data
DESCRIPTION
index the folder provided
See code: dist/commands/crawl.ts
fs-indexer help [COMMAND]
Display help for fs-indexer.
USAGE
$ fs-indexer help [COMMAND] [-n]
ARGUMENTS
COMMAND Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for fs-indexer.
See code: @oclif/plugin-help
fs-indexer info
prints information about the database
USAGE
$ fs-indexer info [-d <value>] [--duplicates] [--debug]
FLAGS
-d, --database=<value> [default: fs-index.db] database file
--debug enable debug logging
--duplicates
DESCRIPTION
prints information about the database
See code: dist/commands/info.ts
fs-indexer lookup PATH
searches for files within the database
USAGE
$ fs-indexer lookup [PATH] [-d <value>] [--debug] [--remove] [--exif]
FLAGS
-d, --database=<value> [default: fs-index.db] database file
--debug enable debug logging
--exif look for files with similar exif date
--remove remove files if similar found in the index. Be careful with this flag. Only hashes are
compared, not the files content.
DESCRIPTION
searches for files within the database
See code: dist/commands/lookup.ts
fs-indexer verify PATH
verifies that the content of the database is in sync with the file system
USAGE
$ fs-indexer verify [PATH] [-d <value>] [-a BLAKE3|XXHASH] [-l <value>] [-m <value>] [-p] [--debug]
FLAGS
-a, --hashingAlgorithms=<option>... hashing algorithms to use
<options: BLAKE3|XXHASH>
-d, --database=<value> [default: fs-index.db] database file
-l, --limit=<value> stop after indexing n files
-m, --minutes=<value> stop after n minutes
-p, --purge deletes files that do not exist anymore from the database
--debug enable debug logging
DESCRIPTION
verifies that the content of the database is in sync with the file system
See code: dist/commands/verify.ts
Development
Generating migrations
After making changes to entities, you can generate a migration to capture the changes with:
./scripts/generate-migration.sh Name
Do not forget to add it to the list of migrations in
src/database/AppDataSource.ts