@jojoxd/vgmdb
v0.0.1
Published
VGMDB Client
Downloads
2
Readme
@jojoxd/vgmdb
VGMDB API Bindings
Installation
yarn install @jojoxd/vgmdb @jojoxd/http-client
Usage
NodeJS / Browser
import { ArtistRepository } from "@jojoxd/vgmdb";
import { HttpClient } from "@jojoxd/http-client";
const artistRepository = new ArtistRepository(new HttpClient(), {
apiUrl: 'https://vgmdb.info', // or your own instance
});
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/vgmdb/tsed';
@Configuration({
vgmdb: {
apiUrl: 'https://vgmdb.info', // or your own instance
},
})
export class Server {}
// service.ts
import { ArtistRepository } from '@jojoxd/vgmdb';
export class Service
{
@Inject()
protected readonly artistRepository!: ArtistRepository;
async searchArtist() {
return this.artistRepository.searchArtists("Freddie Mercury");
}
}