Get the artist and title from a full song name, eg. a YouTube video title.
npm install --save get-artist-title
$ npm install --global get-artist-title$ format-artist-titleUsage$ format-artist-title <input>Example$ format-artist-title "Ga-In (가인) - Nostalgia (노스텔지아) - Lyrics [Hangul+Translation] .mov"Ga-In – Nostalgia
const getArtistTitle =//→ ['Taylor Swift', 'Out Of The Woods']let artist title =//→ ['FEMM', 'PoW!']
Extract the artist and title from
string. Returns an Array with two elements,
[artist, title], or
null if no artist/title can be found.
defaultArtist- Artist name to use if an artist name/song title pair can't be extracted. The input string, minus any cruft, will be used as the song title.
defaultTitle- Song title to use if an artist name/song title pair can't be extracted. The input string, minus any cruft, will be used as the artist name.
It's useful to provide defaults if you're passing strings from an external service. For example, a YouTube video title may not always contain the artist name, but the name of the channel that uploaded it might be relevant.
const artist title =// → ['Channel Name', 'A Brand New Song!']
// Assuming `video` is a Video resource from the YouTube Data API:const artist title =