NPM module for searching songs and albums.
Usage: searchSong(term, options)
term<String>
: The term you want to search up for.options<Object>
: Optional; Option for specifying details of the song.artist<String>
: The artist name of the song you are searching for.album<String>
: The album title of the song you are searching for.
Tip: To fetch an artwork URL or release date, use searchAlbum
instead.
Click to see the returned array (promise)
[
{
type: 'song',
title: String, // title of the song
artist: String, // artist of the song
album: String, // title of the album
genre: String, // genre of the song
trackNumber: Number, // track number of the song
trackLength: Number, // length of the track in milliseconds
available: Boolean, // availability on iTunes
explicit: Boolean
},
// continues...
]
Usage: searchAlbum(term, options)
term<String>
: The term you want to search up for.options<Object>
: Optional; Option for specifying details of the album & artwork size.artist<String>
: The artist name of the album you are searching for.artworkSize<Number>
: The artwork size you want to get. Default value is60
.
Click to see the returned array (promise)
[
{
type: 'album',
title: String,
artist: String,
trackCount: Number,
genre: String,
releaseDate: Date,
explicit: Boolean,
artwork: String
},
// continues...
]
To be added later.
const musicInfo = require('music-info');
musicInfo.searchSong('elegy dedicated with love', { artist: 'ophelia' }).then(data => {
console.log(data); // [ { type: 'song', title: 'Elegy Dedicated with Love', ... }, ... ]
});
musicInfo.searchAlbum('traveler', { artist: 'official hige dandism', artworkSize: 100 }).then(data => {
console.log(data); // [ { type: 'album', title: 'Traveler', artist: 'OFFICIAL HIGE DANDISM', ... }, ... ]
});