New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

paheal

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paheal

Simple and user-friendly Wrapper of Rule 34 Paheal

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source
paheal

paheal

Discord Support License NPM downloads NPM version

Simple and User-Friendly API for rule34 paheal.
Table of content:

Installation

$ npm install paheal

Usage

// 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

Returns the not full object of a post.

ParamTypeDescription
tagsstringTags into Search

Usage example:

// in async function
const search = await paheal.search('devil')
console.log(search.results)
Returns: Promise<Search model object>

getMedia()

ParamTypeDescription
idstring/numberID of Media Post

Usage example:

// in async function
const media = await paheal.getMedia(1)
console.log(media.href)
Returns: Promise<Media model object>

byAuthor()

Returns the not full object of a post.

ParamTypeDescription
namestringFind posts by some Author

Usage example:

// in async function
const search = await paheal.byAuthor('noname')
console.log(search.results)
Returns: Promise<Search model object>

Data Models

Media

{
    author: String,
    tags: String[],
    src: String,
    href: String 
}

Search Class

searchResult {
    results: Array<SearchResult>
    lastPage: Number,
    currentPage: Number
}

Search Result

{
    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.
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:

// 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


License

MIT License

Copyright © Mikun Hatsune

Keywords

FAQs

Package last updated on 11 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc