Giter Site home page Giter Site logo

aniapi-js's Introduction

AniAPI Js

AniAPI js wrapper.

Use

Install

npm install --save aniapi-js

# or yarn

yarn add aniapi-js

Example

import AniAPI from 'aniapi-js'

const aniapi = new AniAPI('token')

aniapi.anime.random(1).then((res) => console.log(res))

aniapi.anime.getById(11).then((res) => console.log(res))

All then params and body data are in official documentation.

Original response

{
  "status_code": 200,
  "message": "Story deleted",
  "data": ...,
  "version": "1"
}

AniAPI-js reponse

this wrapper just return data field inside of original response

{
  ...
}

In case of status code not is 200 return original response.

{
    "status_code": 404,
    "message": "Anime not found",
    "data": "Anime with id 12345 does not exists",
    "version": "1"
}

API version

All the methods support future versions of api /v${v}/..., this is the last parameter of all methods default version it's 1

aniapi.anime.getById(11, 1).then((res) => console.log(res))

Rewards

AniAPI.js for enums ๐Ÿ™Œ

aniapi-js's People

Watchers

James Cloos avatar OsirisFrik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.