@jojoxd/discogs
v0.0.1
Published
Discogs Client
Downloads
1
Readme
@jojoxd/discogs
Discogs API Bindings
Installation
yarn install @jojoxd/discogs @jojoxd/http-client
Usage
NodeJS / Browser
import { ArtistRepository } from "@jojoxd/discogs";
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/discogs/tsed';
@Configuration({
discogs: {
userAgent: 'User-Agent/1.0',
},
})
export class Server {}
// service.ts
import { ArtistRepository } from '@jojoxd/discogs';
export class Service
{
@Inject()
protected readonly artistRepository!: ArtistRepository;
async searchArtist() {
return this.artistRepository.searchArtists("Freddie Mercury");
}
}