# @archie0732/nhentai-api v4

這個庫可以直接下載或是使用`npm`

直接下載，需要安裝依賴

```bash
bun i
```

`npm` 不需要額外下載依賴

```bash

```

## 使用說明

**非常建議先使用`changeSettingConfig`來指定下載路徑**

```ts
import { nhentaiSearchAPI, changeSettingConfig, fetchDoujin } from "../src";
changeSettingConfig() // 指定下載路由，改變下載漫畫路徑
```

- 直接下載

在資料夾`./test`中找檔案 `index.test.ts`，已經將import完成

- `npm` 需要手動import

```ts
import { nhentaiSearchAPI, changeSettingConfig, fetchDoujin } from "../src";
```

- 下載單個漫畫

```ts
import { nhentaiSearchAPI, changeSettingConfig, fetchDoujin } from "../src";

fetchDoujin('1234').then(e=>e.download())
//download 有 option 可以使用 option:{ retry: 重試次數, curr: 最大並行 }
```

- 查看漫畫

```ts
import { nhentaiSearchAPI, changeSettingConfig, fetchDoujin } from "../src";

fetchDoujin('1234').then(e=>console.log(e))
```

- 搜尋漫畫

```ts
import { nhentaiSearchAPI, changeSettingConfig, fetchDoujin } from "../src";

nhentaiSearchAPI('artist', 'yan-yam')
// 可以使用 option: { page: 指定要搜尋第幾頁, sort: 排序方法 }
```

### other

This project was created using `bun init` in bun v1.1.24. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
