# zorostreamts

> A TypeScript library for efficient retrieval of streaming links from the Zoro server, with easy integration and robust error handling.

Latest version **1.0.2** (published 2023-12-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install zorostreamts
pnpm add zorostreamts
yarn add zorostreamts
bun add zorostreamts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-12-20 |
| First published | 2023-12-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ashlin Darius Govindasamy |
| Maintainers | adgsenpai |
| Keywords | zoro, zorostream, zorostreamts, zoro stream, zoro stream ts, api, streaming, anime, anime streaming |

## Links

- npm: https://www.npmjs.com/package/zorostreamts
- npm.io page: https://npm.io/package/zorostreamts

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.6.2
- [fast-levenshtein](https://npm.io/package/fast-levenshtein.md) ^3.0.0

## Recent versions

- 1.0.2 (latest) — 2023-12-20
- 1.0.1 — 2023-12-20
- 1.0.0 — 2023-12-20

## README

# ZoroStreamTS
A TypeScript library for efficient retrieval of streaming links from the Zoro server, with easy integration and robust error handling.

## Features

- Search for anime by name.
- Retrieve the first result's ID from a search query.
- Fetch all episodes of a given anime by ID.
- Find a specific episode by number.
- Retrieve streaming links for a specific episode.
- Utilize Levenshtein distance to find the best match for a given anime name.

## Installation

Before installing, ensure you have Node.js installed. Then, run the following command in your project directory:

```bash
npm install
```

## Usage

Import the functions from the library to start fetching anime data:

```typescript
import { getAnimeEpisode } from 'path-to-library';

// Example usage
getAnimeEpisode(1, "One Piece").then((res) => {
    console.log(res);
});
```

## Mathematics for Searching ( Levenshtein distance algorithm )

```math
D(i, j) = 
 \begin{cases} 
  0 & \text{if } i = 0 \text{ and } j = 0 \\
  i & \text{if } j = 0 \text{ and } i > 0 \\
  j & \text{if } i = 0 \text{ and } j > 0 \\
  D(i-1, j-1) & \text{if } S_1[i] = S_2[j] \\
  1 + \min \begin{cases}
    D(i-1, j),  & \text{(deletion)} \\
    D(i, j-1),  & \text{(insertion)} \\
    D(i-1, j-1) & \text{(substitution)}
  \end{cases} & \text{otherwise}
 \end{cases}
```

## API Functions

- `searchAnime(query: string)`: Searches for animes based on a query string.
- `searchAnimeReturnFirstResultID(query: string)`: Returns the ID of the first anime in the search result.
- `getAnimeEpisodes(animeID: string)`: Fetches all episodes for a given anime ID.
- `getAnimeEpisodeIDByEpisodeNumber(animeID: string, episodeNumber: number)`: Retrieves the ID of a specific episode by its number.
- `getAnimeEpisodeStreamingLinks(episodeSlug: string, categories: string[])`: Gets streaming links for an episode in specified categories (e.g., 'sub', 'dub').
- `findBestAnimeMatch(query: string)`: Finds the best match for an anime name using Levenshtein distance.

## Debugging

Uncomment the debugging section in the code to test the functionality with an example query.


## Credits

This project utilizes the [aniwatch-api](https://github.com/ghoshritesh12/aniwatch-api) developed by Ritesh Ghosh. Special thanks to their contributions and efforts in providing an efficient API for anime data retrieval.

## Contributing

Contributions to this project are welcome. Please ensure to follow the existing code style and add unit tests for any new or changed functionality.

---
_Source: https://npm.io/package/zorostreamts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
