@jojoxd/musicbrainz
v0.0.1
Published
Musicbrainz Client
Downloads
1
Readme
@jojoxd/musicbrainz
Musicbrainz API Bindings
Installation
yarn install @jojoxd/musicbrainz @jojoxd/http-client
Usage
NodeJS / Browser
import { ArtistRepository } from "@jojoxd/musicbrainz";
import { HttpClient } from "@jojoxd/http-client";
const artistRepository = new ArtistRepository(new HttpClient(), {
userAgent: 'User-Agent/1.0',
});
const artists = await artistRepository.searchArtists("Freddie Mercury");
TsED
Note: This requires
@tsed/di
to be installed.
// Server.ts
import '@jojoxd/http-client/tsed';
import '@jojoxd/musicbrainz/tsed';
@Configuration({
musicbrainz: {
userAgent: 'User-Agent/1.0',
},
})
export class Server {}
// service.ts
import { ArtistRepository } from '@jojoxd/musicbrainz';
export class Service
{
@Inject()
protected readonly artistRepository!: ArtistRepository;
async searchArtist() {
return this.artistRepository.searchArtists("Freddie Mercury");
}
}