# paheal

> Simple and user-friendly Wrapper of Rule 34 Paheal

Latest version **1.0.3** (published 2021-10-11) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-10-11 |
| First published | 2021-10-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Mikun Hatsune |
| Maintainers | mikun_hatsune |
| Keywords | anime, rule34, paheal, hentai, nsfw, images, gifs, ahegao, ass, neko, kitsune, yuri, panties, thighs, foot, erotic, lewdkemo, lewdneko, lewdkitsune, holo, bj, spank, ero, kawaii, cute, waifu, zettaiRyouiki, 18+, REST, API, Mikun |

## Links

- npm: https://www.npmjs.com/package/paheal
- Homepage: https://discord.gg/Cak7GBJ
- npm.io page: https://npm.io/package/paheal

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.21.4
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.10
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.2
- [cheerio-tableparser](https://npm.io/package/cheerio-tableparser.md) ^1.0.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-10-11
- 1.0.2 — 2021-10-11
- 1.0.1 — 2021-10-11
- 1.0.0 — 2021-10-11

## README

<div align="center">
<a href="https://discord.gg/Cak7GBJ"><img src="https://cdn.discordapp.com/attachments/707201738255368194/897181637907980348/paheal_non-background.png" width="546" alt="paheal"></a>
</div>

<h1 align="center" font-weight="bold">paheal</h1>

<p align="center">
  <a href="https://discord.gg/Cak7GBJ"><img src="https://img.shields.io/discord/714877734978846830?color=7289da&logo=discord&logoColor=white" alt="Discord Support" /></a>
  <a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
  <img src="https://img.shields.io/npm/dt/paheal" alt="NPM downloads">
  <img src="https://img.shields.io/npm/v/paheal" alt="NPM version">
</p>

> #### Simple and User-Friendly API for [rule34 paheal](https://rule34.paheal.net/).
> #### Recommended for REST API, Bots, Sites

#### Table of content:

* **[Installation](#installation)**
* **[Usage](#usage)**
* **[Methods](#methods)**
  * [search()](#search)
  * [getMedia()](#getMedia)
  * [byAuthor()](#byAuthor)
* **[Data models](#data-models)**
  * [Media](#media)
  * [Search Class](#search-class)
  * [Search Result](#Search-Result)
* **[Catching Errors without .catch()](#Catching-Errors-without-catch)**
* **[Discord Support](#Support)**
* **[License](#license)**

## Installation
```bash
$ npm install paheal
```

## Usage
```js
// in async function
const paheal = require('paheal')
const API = new paheal

// Get a Random Doujin
await API.search().then(search => console.log(search.results))

// Get a indicated Doujin
await API.getMedia(1).then(media => console.log(media))

// Searching
await API.byAuthor('dev').then(search => console.log(search.results))

// Next Page
const search = await API.search('devil')
const nextPage = await search.next()
console.log(nextPage.results)
```

## Methods
### search()

> *Returns the **[not full object](#Search-Result)** of a post.*

> | Param | Type  |     Description     |
> |  ---  |  ---  |         ---         |
> | tags | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | Tags into Search |
>
> Usage example: 
> ```js
> // in async function
> const search = await paheal.search('devil')
> console.log(search.results)
> ```
>
> ###### *Returns: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Search model](#search-class) [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>*

---

### getMedia()

> | Param | Type  |     Description     |
> |  ---  |  ---  |         ---         |
> | id | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)/[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | ID of Media Post |
>
> Usage example: 
> ```js
> // in async function
> const media = await paheal.getMedia(1)
> console.log(media.href)
> ```
>
> ###### *Returns: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Media model](#media) [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>*

---

### byAuthor()

> *Returns the **[not full object](#Search-Result)** of a post.*

> | Param | Type  |     Description     |
> |  ---  |  ---  |         ---         |
> | name | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | Find posts by some Author |
>
> Usage example: 
> ```js
> // in async function
> const search = await paheal.byAuthor('noname')
> console.log(search.results)
> ```
>
> ###### *Returns: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Search model](#search-class) [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>*

---

## Data Models

### Media
```js
{
    author: String,
    tags: String[],
    src: String,
    href: String 
}
```

### Search Class
```js
searchResult {
    results: Array<SearchResult>
    lastPage: Number,
    currentPage: Number
}
```

### Search Result
```js
{
    id: Number,
    tags: String[],
    href: String 
}
```

## Catching Errors without .catch()

In a Node.JS 15.x, reject use a strict mode. So, when Promise returns a reject, your app crashes.
<br>So, my library is user-friendly, and i don't want crash your app, if some wrong. So, how you can catch a errors?

For Example:
```js
// in async function
let search = await paheal.search('devil')
if (search.status) return console.error(search.message);
```
And, your app don't be crashes :)

## Support

[Discord Server](https://discord.gg/Cak7GBJ)

---

## License
MIT License

Copyright © Mikun Hatsune

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