Mccranky83 / node-hitomi

Hitomi.la api for Node.js

Home Page:https://npm.im/node-hitomi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

banner

Hitomi.la api for Node.js

Would you call me a gentleman?

npm version npm type definition license


Installation

NOTICE: Please always use the latest version of the package.
Since Hitomi changes its method to get image url often, legacy version may not work.

Using npm:

$ npm install node-hitomi

Using yarn:

$ yarn add node-hitomi

Features

  • Get gellary ids by index range
  • Get gallary data by id
  • Parse, query and get tags
  • Get hitomi-related urls

Without any dependencies!

Usage/Examples

setup:

// CommonJS
const hitomi = require('node-hitomi').default;

// ES Module
import hitomi from 'node-hitomi';

printing title and id of gallery number x:

hitomi.getGallery(x)
.then(function (value) {
  console.log(value['title']['display'], value['id']);
});

printing supported tags for female starting with letter b:

hitomi.getTags('female', { startWith:'b' })
.then(function (value) {
  console.log(value);
});

printing number of language korean gallery without female tag netorare:

hitomi.getIds({ tags: [{
  type: 'language',
  name: 'korean'
}, {
  type: 'female',
  name: 'netorare',
  isNegative: true
}] })
.then(function (value) {
  console.log(value['length']);
});

Contribution

Contribution, issues and feature requests are welcome!
Feel free to check issues page.

About

Hitomi.la api for Node.js

https://npm.im/node-hitomi

License:MIT License


Languages

Language:TypeScript 94.0%Language:JavaScript 6.0%