1.1.14 • Published 7 years ago

epub-metadata-parser v1.1.14

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

epub-metadata-parser

Introduction

Use it to parse metadata and extract book cover(if available) from epub files so that you can use it in your applications. Outputs a simplified JSON file. Will put the files in the folders given by the user appended by "/Books/Author Name/Book Name". Works in similar fashion to calibredb from Calibre. Only epub files are supported and the files must comply with IDPF Open Packaging Format Specification.

Requirements

Depends on lodash, mkdirp, yauzl, xml2js packages. You can subtitute similar ones as well (i.e underscore for lodash).

Usage

You can extract json file as simple as given in the example below. Note that the first argument is the input file and the second argument is the output directory.

var epubParser = require('epub-metadata-parser');
epubParser.parse('./tester.epub', '../Documents' , book => {
    console.log(book);
});

The outputted JSON file has these properties (cover is undefined if not found):

{ author: 'Lewis Carroll',
  title: 'Alice\'s Adventures in Wonderland',
  description: "Alice\'s Adventures in Wonderland (1865) is a novel written by English author Charles Lutwidge Dodgson, better known under the pseudonym Lewis Carroll. It tells the story of a girl named Alice who falls down a rabbit-hole into a fantasy world populated by peculiar and anthropomorphic creatures.\r\nThe tale is filled with allusions to Dodgson\'s friends (and enemies), and to the lessons that British schoolchildren were expected to memorize. The tale plays with logic in ways that have made the story of lasting popularity with adults as well as children. It is considered to be one of the most characteristic examples of the genre of literary nonsense, and its narrative course and structure has been enormously influential, mainly in the fantasy genre.",
  cover: 'book-cover',
  subject: [ 'Fiction', 'Fantasy', 'Juvenile' ],
  language: 'en',
  publisher: 'Feedbooks',
  pubdate: '1897',
  fileName: 'tester.epub' }

Bugs

After testing the parser with over 2000 books, it seems now stable and handles errors correctly however, any bug reports are most welcomed.

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago