ts-cardfight-vanguard-api
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

ts-cardfight-vanguard-api

coverage-functions coverage-lines license downloads version coffe

introduction

A typescript based library that fetches data (using axios) from card-fight-vanguard-api created by Brent Pappas. Look at his documentation for more information.

install

npm install ts-cardfight-vanguard-api

Docs

Get cards

Returns an Object with an array of 50 cards and pagination data from the API. the page by default is 1.

import { getCards } from 'ts-cardfight-vanguard-api';

const response = await getCards();
console.log(response);
//{ data: Array[50], paging: { page: 1, pagesize: 50 } }
import { getCards } from 'ts-cardfight-vanguard-api';

const params = {grade: "0", clan: "Link Joker", page: 3};
const response = await getCards(params);
console.log(response);
// { data: Array[50], paging: { page: 3, pagesize: 50 } }

Get card

Returns a card from the api. It allows parameters with provided id

import { getCard } from 'ts-cardfight-vanguard-api';

const data = await getCards(1);
console.log(data)
// { name, clan, grade, ... }

Get Sets

return an array with the name of all the available sets from the API.

import { getSets } from 'ts-cardfight-vanguard-api';
const response = await getSets();
console.log(response);
// ["Extra Booster: Divas Duet", "Booster Set 8: Blue Storm Armada", ...]

Depencences

Credits

Thanks to Brent Pappas for creating this elaborated API that allows this package to exist.

Package Sidebar

Install

npm i ts-cardfight-vanguard-api

Weekly Downloads

5

Version

1.1.0

License

MIT

Unpacked Size

12 kB

Total Files

15

Last publish

Collaborators

  • crow-onslaught