Using KanColle's main.js
in Node.js.
yarn add @kancolle/main
See src/test.js
for some working examples. See dist/api
for more functions.
To build files in dist
:
# tested with node v20, e.g.
nvm install 20
nvm use 20
# disable ignore-scripts for the following command (to build canvas)
yarn
# this will build dist/main.js, using js-beautify, as it generates shorter file than prettier
yarn build
# this will try loading dist/main.js and running src/test.js on it
yarn test
dist/main.js
is the final patched file.
- After
main.init()
a request toversion.json
will be performed withaxios
, that won't work due to browser security related issues, more browser simulation is required. Similarly, many functions won't work withoutapi_start2
response. For example,main.ShipLoader.getPath
need versions fromapi_start2
. - It is better to mock all the things rather than pulling heavy dependencies (like
canvas
).