@comix/parser
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@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

  • [x] Read CBZ files
  • [x] 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

Package Sidebar

Install

npm i @comix/parser

Weekly Downloads

33

Version

0.1.0

License

ISC

Unpacked Size

2.31 MB

Total Files

27

Last publish

Collaborators

  • zuren