epub-cover-extractor

Extract cover images from ePub documents.

Package version

Installation

To install via npm:

npm install epub-cover-extractor --save

Usage

Import

var extractCover = require('epub-cover-extractor');

Extract Cover Image from File

extractCover.fromFilePath(filePath, './', function(err, filePath){
  if (err) throw err;
  console.log(filePath);
  /*
  cover-image-filename.jpg
  */
});

Extract Cover Image from Buffer

extractCover.fromBuffer(buffer, './', function(err, filePath){
  if (err) throw err;
  console.log(filePath);
  /*
  cover-image-filename.jpg
  */
});