0.0.2 • Published 3 years ago

@fubasi/kkmh v0.0.2

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

connectors-kkmh

Node.js client for kuaikanmanhua.com

Installing

npm install @fubasi/kkmh

Usage

const { KkmhConnector, KkmhIdentity } = require('@fubasi/kkmh');
const { promises: fs } = require('fs');

const user = new KkmhIdentity('+12223334455', 'examplepassword');
const client = new KkmhConnector(user);

client.chapter(382057).then(manifest => {
  // Metadata for chapter
  console.log('Manifest:', manifest);
  // Downloading first chunk of first page
  return client.image(manifest.chunks[0][0]);
}).then(image => {
  console.log('Image size:', image.length);
  // Save chunk to file
  return fs.writeFile('test.jpg', image);
}).then(() => {
  console.log('Done!');
});