1.1.0 • Published 10 months ago
anilist-3x3-generator v1.1.0
anilist-3x3-generator
NodeJS library that generates a 3x3 grid based on the user's anilist profile using canvas.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation is done using the
npm install
command:
$ npm install anilist-3x3-generator
Usage
const generator = require('anilist-3x3-generator');
generator.generateAnimeGrid('JohnTanaka', { rows: 4, columns: 4, borderWidth: 5 }); //returns a canvas of a 4x4 with 5px width lines between the images
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
user | string | Anilist username. (required) | |
outputPath | string | The output path for saving the generated image. | |
base64 | bool | Indicates whether to return the image in Base64 format. Returns a canvas object if false. | false |
rows | number | Number of rows in the image grid. | 3 |
columns | number | Number of columns in the image grid. | 3 |
borderWidth | number | Border width. | 3 |
borderColour | string | Border colour. | "black" |
imageWidth | number | Image width. | 230 |
imageHeight | bool | Image height. | 331 |
type | string | Favorite category to use ("anime", "manga", "characters", "staff") | "anime" |
randomFav | bool | Indicates whether to shuffle favorite items. | false |
License
This project is licensed under the MIT License