@pixim/core
v3.0.0
Published
Powerful Pixiv API client for browser/Node.js
Downloads
6
Readme
@pixim/core
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
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 namepicture
for the later. - Plural of manga is mangas
License
AGPL-3.0-or-later