Skip to content

Anime girls holding programming books API wrapper for 🟦 TypeScript.

License

Notifications You must be signed in to change notification settings

THEGOLDENPRO/aghpb.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🟦 aghpb.ts 📚

Typescript API wrapper for the anime girls holding programming books API

npm


Note

This is part of my aghpb api wrapper challenge where I attempt to write an api wrapper in every language possible. So yes expect spaghetti code as it will be my first time writing in these languages. Although I'm 100% open to improvements and corrections so feel free to contribute anything. Other languages I've done

Install

npm install aghpb

The NPM package can be located here.

Examples

This is how you may retrieve a random anime girl holding a programming book:

import * as fs from "fs";
import { Client } from "aghpb";

const client = new Client();

client.random().then(
    (book) => {
        console.log(`Name: ${book.name}`);
        console.log(`Category: ${book.category}`);
        console.log(`Date Added: ${book.dateAdded}`);

        const buffer = Buffer.from(book.image)

        fs.createWriteStream("./anime_girl.png").write(
            buffer
        );
    }
);

You can also retrieve specific categories of anime girls holding programming books like so:

client.random("typescript");

This is how you may retrieve a list of available categories:

import { Client } from "aghpb";

const client = new Client();

client.categories().then(
    (categories) => {
        categories.forEach((category) => {
            console.log(category);
        })
    }
);

Made using my API at 👉 https://api.devgoldy.xyz/aghpb/v1/