Skip to content

Commit c4878a7

Browse files
committed
docs: update README.md for clarity and structure
- Simplified the introduction and added a brief overview of the AniList API Wrapper. - Reorganized sections for better flow, including a new "What's this?" section. - Enhanced the Quick Start guide with clearer instructions and examples. - Updated the features and usage sections to provide more detailed information on capabilities. - Improved formatting and consistency throughout the document.
1 parent 607621d commit c4878a7

File tree

1 file changed

+73
-150
lines changed

1 file changed

+73
-150
lines changed

README.md

Lines changed: 73 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,118 @@
1-
<h1 align="center">
2-
  🚀 AniList API Wrapper for TypeScript
3-
</h1>
1+
# AniList API Wrapper for TypeScript
42

5-
<p align="center">
6-
<a href="https://www.npmjs.com/package/@tdanks2000/anilist-wrapper"><img alt="npm version" src="https://img.shields.io/npm/v/@tdanks2000/anilist-wrapper"></a>
7-
<a href="https://github.com/tdanks2000/anilist-wrapper/blob/master/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/@tdanks2000/anilist-wrapper"></a>
8-
<a href="https://github.com/tdanks2000/anilist-wrapper/actions/workflows/ci.yml"><img alt="build status" src="https://github.com/tdanks2000/anilist-wrapper/actions/workflows/ci.yml/badge.svg"></a>
9-
<a href="https://bundlephobia.com/package/@tdanks2000/anilist-wrapper"><img alt="bundle size" src="https://img.shields.io/bundlephobia/minzip/@tdanks2000/anilist-wrapper"></a>
10-
</p>
3+
A simple, type-safe TypeScript wrapper for the AniList API. Build awesome anime and manga apps without the hassle of dealing with raw GraphQL queries.
114

12-
<p align="center">
13-
Simplify your integration with the <a href="https://docs.anilist.co/">AniList API</a>, a comprehensive database for anime and manga. This robust and type-safe TypeScript wrapper provides an intuitive way to access various AniList functionalities, making it easier than ever to build amazing applications related to anime and manga.
14-
</p>
5+
[![npm version](https://img.shields.io/npm/v/@tdanks2000/anilist-wrapper)](https://www.npmjs.com/package/@tdanks2000/anilist-wrapper)
6+
[![license](https://img.shields.io/npm/l/@tdanks2000/anilist-wrapper)](https://github.com/tdanks2000/anilist-wrapper/blob/master/LICENSE)
7+
[![build status](https://github.com/tdanks2000/anilist-wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/tdanks2000/anilist-wrapper/actions/workflows/ci.yml)
8+
[![bundle size](https://img.shields.io/bundlephobia/minzip/@tdanks2000/anilist-wrapper)](https://bundlephobia.com/package/@tdanks2000/anilist-wrapper)
9+
10+
## What's this?
1511

16-
## 📖 Table of Contents
17-
18-
- [✨ Key Features](#key-features)
19-
- [🚀 Quick Start](#quick-start)
20-
- [📦 Installation](#installation)
21-
- [🛠️ Usage](#usage)
22-
- [Basic Initialization](#basic-initialization)
23-
- [Making API Calls](#making-api-calls)
24-
- [🔑 Authentication](#authentication)
25-
- [⚙️ Functionality](#functionality)
26-
- [Anime Service](#anime-service)
27-
- [Character Service](#character-service)
28-
- [Manga Service](#manga-service)
29-
- [Media Service](#media-service)
30-
- [MediaList Service](#medialist-service)
31-
- [Staff Service](#staff-service)
32-
- [User Service](#user-service)
33-
- [🤝 Contributing](#contributing)
34-
- [📜 License](#license)
35-
- [💖 Support](#support)
36-
37-
## ✨ Key Features
38-
39-
- **Type-Safe TypeScript:** Enjoy the benefits of static typing and improved developer experience.
40-
- **Comprehensive Coverage:** Access a wide range of AniList API endpoints, including anime, manga, characters, staff, user lists, and more.
41-
- **Simplified Requests:** Abstract away the complexities of making raw HTTP requests to the AniList GraphQL API.
42-
- **Modular Design:** Well-organized services for different aspects of the AniList API.
43-
- **Easy Authentication:** Simple integration with AniList's authentication mechanism.
44-
45-
## 🚀 Quick Start
46-
47-
Get up and running with the AniList API Wrapper in minutes!
48-
49-
1. **Install the package:**
12+
Ever wanted to build something cool with anime data but got stuck trying to figure out AniList's GraphQL API? This wrapper makes it dead simple. Just import, initialize, and start fetching data.
13+
14+
Built with TypeScript for that sweet autocomplete and type safety. No more guessing what properties are available on your anime objects!
15+
16+
## Quick Start
5017

5118
```bash
52-
# npm
5319
npm install @tdanks2000/anilist-wrapper
54-
# yarn
55-
yarn install @tdanks2000/anilist-wrapper
56-
# pnpm
57-
pnpm install @tdanks2000/anilist-wrapper
58-
# bun
59-
bun install @tdanks2000/anilist-wrapper
6020
```
6121

62-
2. **Import and initialize:**
63-
64-
```ts
22+
```typescript
6523
import { Anilist } from "@tdanks2000/anilist-wrapper";
6624

67-
// For public endpoints
25+
// Create an instance (no token needed for public data)
6826
const anilist = new Anilist();
69-
// OR for authenticated endpoints
70-
const anilist = new Anilist("YOUR_ACCESS_TOKEN");
71-
```
7227

73-
3. **Start making API calls:**
28+
// Get info about Attack on Titan
29+
const aot = await anilist.anime.getAnimeById(16498);
30+
console.log(aot.title.english); // "Attack on Titan"
7431

75-
```ts
76-
const data = await anilist.anime.getAnimeById(1);
77-
console.log(data);
32+
// Search for anime
33+
const results = await anilist.anime.searchAnime("One Piece");
34+
console.log(results.length); // Number of results found
7835
```
7936

80-
## 📦 Installation
37+
## What can you do?
8138

82-
To integrate the AniList TypeScript Wrapper into your project, use one of the following package managers:
39+
### Anime
40+
- Get anime by ID or search by title
41+
- Fetch characters, staff, and recommendations
42+
- Get trending and popular anime
43+
- Find anime by genre
8344

84-
```bash
85-
# npm
86-
npm install @tdanks2000/anilist-wrapper
87-
# yarn
88-
yarn install @tdanks2000/anilist-wrapper
89-
# pnpm
90-
pnpm install @tdanks2000/anilist-wrapper
91-
# bun
92-
bun install @tdanks2000/anilist-wrapper
93-
```
45+
### Manga
46+
- Same features as anime, but for manga
47+
- Search, get details, characters, staff, etc.
9448

95-
## 🛠️ Usage
49+
### Characters & Staff
50+
- Get character info and birthdays
51+
- Find staff members and their work
52+
- Toggle favorites (with auth)
9653

97-
Learn how to use the AniList TypeScript Wrapper in your TypeScript project.
54+
### Users
55+
- Get user profiles and statistics
56+
- Fetch user's anime/manga lists
57+
- Requires authentication
9858

99-
### Basic Initialization
59+
### Media Lists
60+
- Manage user's anime and manga lists
61+
- Add, update, remove entries
62+
- Requires authentication
10063

101-
Import the `Anilist` class from the package:
64+
## Authentication
10265

103-
```
104-
import { Anilist } from "@tdanks2000/anilist-wrapper";
66+
Some features need you to be logged in. Get an access token from [AniList's auth guide](https://docs.anilist.co/guide/auth/) and pass it to the constructor:
67+
68+
```typescript
69+
const anilist = new Anilist("your_access_token_here");
10570
```
10671

107-
Create an instance of the `Anilist` class. You can optionally provide an access token for authenticated requests:
72+
## Examples
10873

74+
### Get trending anime
75+
```typescript
76+
const trending = await anilist.anime.getAnimeTrending();
77+
console.log(trending[0].title.english);
10978
```
110-
// For accessing public endpoints
111-
const anilist = new Anilist();
11279

113-
// For accessing authenticated endpoints (requires an access token)
114-
const anilistWithToken = new Anilist("YOUR_ACCESS_TOKEN");
80+
### Search for characters
81+
```typescript
82+
const characters = await anilist.character.getCharacterById(1);
83+
console.log(characters.name.full);
11584
```
11685

117-
### Making API Calls
118-
119-
The `anilist` object provides access to various services, each dedicated to a specific area of the AniList API. Here's a basic example of fetching anime details:
120-
121-
```ts
122-
const data = await anilist.anime.getAnimeById(1);
123-
console.log(data);
86+
### Get user's anime list
87+
```typescript
88+
const userList = await anilist.user.getUserAnimeList("username");
89+
console.log(userList.length); // Number of anime in their list
12490
```
12591

126-
Refer to the [Functionality](#functionality) section for a list of available services and their purpose. Consult the individual service files or generated documentation for specific methods and parameters.
127-
128-
## 🔑 Authentication
129-
130-
Some features of the AniList API require authentication. To authenticate, you need to obtain an OAuth access token from the AniList website. [Follow their official documentation](https://docs.anilist.co/guide/auth/) for instructions on how to generate an access token.
131-
132-
Once you have your access token, you can provide it when creating an instance of the `Anilist` class:
133-
134-
```
135-
const anilist = new Anilist("YOUR_ACCESS_TOKEN");
92+
### Find anime by genre
93+
```typescript
94+
const actionAnime = await anilist.anime.getAnimeListByGenre("Action");
95+
console.log(actionAnime.length); // Number of action anime
13696
```
13797

138-
This will enable you to access authenticated endpoints and perform actions on behalf of a user.
139-
140-
## ⚙️ Functionality
141-
142-
The AniList API Wrapper organizes its functionality into the following services:
143-
144-
### Anime Service
145-
146-
Provides methods for accessing anime-related information, such as:
147-
148-
- Fetching details about a specific anime.
149-
- Retrieving characters and staff associated with an anime.
150-
- Getting recommendations for similar anime.
151-
- Exploring related anime entries.
152-
153-
### Character Service
154-
155-
Allows you to retrieve information about specific anime and manga characters.
156-
157-
### Manga Service
158-
159-
Offers methods for accessing manga-related information, similar to the Anime Service, including details, characters, staff, and recommendations.
160-
161-
### Media Service
162-
163-
Provides general functions for searching and retrieving information about both anime and manga (media). This might include broader search capabilities or combined results.
164-
165-
### MediaList Service
166-
167-
Enables you to manage a user's anime and manga lists, including adding, updating, and retrieving entries. This requires authentication.
168-
169-
### Staff Service
170-
171-
Allows you to retrieve information about staff members involved in the production of anime and manga (e.g., voice actors, directors, writers).
172-
173-
### User Service
174-
175-
Provides access to user profiles, statistics, and their anime and manga lists. Many of these endpoints require authentication.
98+
## Contributing
17699

177-
## 🤝 Contributing
100+
Found a bug? Want to add a feature? Contributions are welcome! Check out the [contributing guide](CONTRIBUTING.md) to get started.
178101

179-
We welcome contributions to the AniList TypeScript Wrapper! If you have any bug reports, feature requests, or would like to contribute code, please follow the guidelines outlined in the repository's `CONTRIBUTING.md` file.
102+
## License
180103

181-
## 📜 License
104+
MIT License - use it however you want!
182105

183-
The AniList TypeScript Wrapper is open-source and licensed under the [MIT License](https://github.com/Api-Wrappers/anilist-wrapper/blob/main/LICENSE). Feel free to use, modify, and distribute this library according to the terms of the license.
106+
## Support
184107

185-
## 💖 Support
108+
Having trouble? Open an issue on [GitHub](https://github.com/tdanks2000/anilist-wrapper/issues) and I'll help you out.
186109

187-
Thank you for using the AniList API Wrapper! If you encounter any issues or have questions, please don't hesitate to:
110+
---
188111

189-
- Open an issue on the [GitHub repository](https://github.com/tdanks2000/anilist-wrapper/issues).
112+
# ❤️
190113

191114
<p align="center">
192115
<a target="_blank" href="https://tdanks.com/mental-health/quote">
193-
❤️ Reminder that <strong\><i\>you are great, you are enough, and your presence is valued.</i\>\</strong\> If you are struggling with your mental health, please reach out to someone you love and consult a professional. You are not alone. ❤️
116+
❤️ Quick reminder: <strong><i>you are great, you are enough, and we value your presence.</i></strong> If you're going through a tough time with your mental health, please reach out to someone you trust and consider talking to a professional. You're never alone. ❤️
194117
</a>
195118
</p>

0 commit comments

Comments
 (0)