npm module for searching songs and albums.
term<String>
: The term you want to search up for.option<Object>
: Object for additional options when searching up.type<String>
:all
|song
|album
- The type of media you want to search up for. Default is
all
.
- The type of media you want to search up for. Default is
artworkSize<Number>
: Size of the artwork. Default is600
.length<Number>
: The number of results you want to get. Default is3
.
Don't pass any configuration in order to search for anything that matches the search keyword.
Or you can set the type
to all
in order to achieve the same result.
const musicInfo = require('music-info');
musicInfo.search("I'm not the only one").then(console.log);
const musicInfo = require('music-info');
musicInfo.search('November Rain', { type: 'song', artworkSize: 1000 }).then(console.log);
1000
is the size of the artwork. Default value is 600.artist
andalbum
parameters are optional.
Click to see the returned object (promise)
{
type: 'song',
title: String, // title of the song
artist: String, // artist of the song
available: Boolean, // on iTunes
explicit: Boolean,
length: String, // ex. 3:30 for 3 minutes 30 seconds long
album: { // info of the album
type: 'album',
title: String, // title of the album
artist: String, // artist of the album
trackCount: Number,
genre: String,
releaseDate: Date,
explicit: Boolean,
artwork: String
}
}
const musicInfo = require('music-info');
musicInfo.search('appetite for destruction', { type: 'album' }).then(console.log);
1000
is the size of the artwork. Default value is 600.artist
parameter is optional.
Click to see the returned object (promise)
{
type: 'album',
title: String,
artist: String,
trackCount: Number,
genre: String,
releaseDate: Date,
explicit: Boolean,
artwork: String
}
const musicInfo = require("music-info");
musicInfo.getLyrics("since i don't have you", { artist: 'Guns N Roses' }).then(console.log);
artist
parameter is optional.
Click to see the returned object (promise)
{
url: String,
lyrics: String
}