@pixim/core
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@pixim/core

npm

Powerful Pixiv API client for browser/Node.js

Features

  • Static typing with TypeScript
  • Compatible with both of browser and Node.js
  • List implemented with Async iterator

Installation

npm i @pixim/core --save

Become a patron

Usage

import { Pixiv } from '@pixim/core';

const token = await Pixiv.login({
  username: 'foobar123',
  password: 'password',
  client_id: 'Clinet ID',
  client_secret: 'Client secret',
}).then(({response}) => response.access_token);

const pixiv = new Pixiv({ token });

pixiv.fetchUserDetail('12345').then((user) => {
  console.log(user) // -> data of the user
})

for await (const illusts of pixiv.fetchRankingPictrues('day')) {
  console.log(illusts) // -> Daily ranking with pagination
}

Development

yarn --pure-lockfile
yarn run test
yarn run build

Notes

  • In Pixiv API, there's two meanings of illust. One is just an illustration, the other is an union of illustrations and mangas. Therefore, we're using name picture for the later.
  • Plural of manga is mangas

License

AGPL-3.0-or-later

Readme

Keywords

none

Package Sidebar

Install

npm i @pixim/core

Weekly Downloads

3

Version

3.0.0

License

AGPL-3.0-or-later

Unpacked Size

113 kB

Total Files

51

Last publish

Collaborators

  • neetshin