0.1.0 • Published 3 years ago

@comix/parser v0.1.0

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

@comix/parser

Reads CBZ and CBR comic files in the browser.

Examples

reading a comic file from a form submission

import { Parser } from '@comix/parser'

form.addEventListener('submit', async e => {
  e.preventDefault()

  const input = form.children[0]
  const file = input.files[0]

  const parser = new Parser()
  const comic = parser.parse(file)

  console.log(comic)
  // {
  //   name: 'Sandman_Vol1.cbr',
  //   pages: [
  //     {
  //       index: 0,
  //       name: '0001.jpg',
  //       read: () => // Uint8Array of image data
  //     },
  //     ...
  //   ]
  // }
})

Todo

  • Read CBZ files
  • Read CBR files
  • Automatically determine page size
  • Support parsing in nodejs
  • Support PDF and epub files
  • Support loading WASM via HTTP rather than including in bundle