node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

epub-cover-extractor

epub-cover-extractor

Use this node module to extract cover images from ePub documents.

Installation

npm install epub-cover-extractor

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
  */
});