tagtoname
Renames audio files using the metadata tags
Installing
npm install tagtoname
CLI
Usage: tagtoname [-k] [-n] [-s separator] [-t tag]... file...
Renames audio files using the metadata tags.
Options:
-k, --keep-case Keep the original case of the tags when renaming
-n, --noop Dry run, show new paths without renaming the files
-s, --separator=SEPARATOR Split tags with SEPARATOR;
defaults to -s-
-t, --tag=TAG Append TAG(s) to the new name;
defaults to -t artist -t title
--help Show help
--version Output the version number
For example, by default a file with the "mp3" ext, the artist tag "Beethoven",
and the title tag "Ode to Joy" is renamed to "beethoven-ode-to-joy.mp3".
See the list of supported tags (the -t
option accepts any value from the "Common tag" column).
Examples
tagtoname file.mp3
tagtoname folder/*
tagtoname -k file.mp3
tagtoname -n folder/*
tagtoname -s / file.mp3
tagtoname -t title -t year file.mp4
API
tagtoname(paths, options)
Renames an audio file using its metadata tags. Resolves with the new path.
The first argument is the path
of the file to be renamed.
The second argument is an options object with the following properties:
keepCase
: Keep the original case of the tags when renaming, defaults to false
noop
: Perform a dry run without renaming the file, defaults to false
separator
: The separator used to split the tags in the new name, defaults to "-"
tags
: An array of the tags used in the new name, defaults to ["artist", "title"]
Examples
import tagtoname from "tagtoname";
tagtoname("/file.mp3").then(console.log);
tagtoname("/file.mp3", { keepCase: true }).then(console.log);
tagtoname("/file.mp3", { separator: "/" }).then(console.log);
tagtoname("/file.mp3", { tags: ["year", "title"] }).then(console.log);
License
MIT