1.1.5 • Published 4 years ago

@tibowl/node-gkcoi v1.1.5

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

node-gkcoi

License

Generate KC organization images in Node.js. Originally developed by Nishisonic for web canvas.

Exports Deckbuilder format fleets into an image.

npm.io

  • There might be some visual differences due to changes

Description

Allows you to create ElectronicObserver style fleet images on server-side. Also includes dark theme.

Supports Japanese, English, Korean and Chinese (Simplified)

Usage

import { generate } from "@tibowl/node-gkcoi";

// DeckBuilder
const deck = {
  hqlv: 120,
  theme: "dark",
  lang: "en",
  f1 = {
    s1: {
      id: 463,
      lv: 175,
      hp: 38,
      fp: 71,
      tp: 118,
      ar: 55,
      aa: 70,
      asw: 108,
      ev: 127,
      los: 94,
      luck: 62,
      items: {
        i1: { id: 122, rf: 10 },
        i2: { id: 122, rf: 10 },
        i3: { id: 106 },
        i4: { id: 173, rf: 4 },
      },
    },
  },
};

const output = await generate(deck); // returns node-canvas Canvas

await writeFile("deck.png", output.toBuffer());

npm.io

Format

Refer to original gkcoi documentation.

Differences

Also comes with a configure function to set cache directory. This is to reduce HTTP requests on server-side. If you already have api_start2 data within your application, it can be passed through via generate(..., { start2Data }).

Examples

See ./test/index.ts for a small example. Asashio's randomfleet.ts is a larger use-case, includes setting up cache, converting TsunDB format and passes own api_start2 data.

Install

Fork, for use in node.js

$ npm install @tibowl/node-gkcoi

Original, for use on web

$ npm install gkcoi

License

MIT License
※コードのみ

  • Chart.js

  • chartjs-plugin-datalabels

  • chartjs-plugin-colorschemes

  • ElectronicObserver

  • kc3-translations

Author

にしくま(Nishisonic)

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago