Generates a metadata.xml file for an EPUB from various online sources, can be used with pandoc
Go to file
Nemo 105dad2f76
Create FUNDING.yml
2022-05-30 14:47:54 +05:30
.github Create FUNDING.yml 2022-05-30 14:47:54 +05:30
.editorconfig Initial Commit 💥 2020-02-10 18:28:20 +05:30
.gitignore Initial Commit 💥 2020-02-10 18:28:20 +05:30
.npmignore Adds npmignore 2021-05-11 12:45:21 +05:30
LICENSE [license] Adds copy of LICENSE text 2021-05-11 12:44:18 +05:30 Improves README 2020-02-19 21:14:48 +05:30
cli.js Fixes date and cover 2020-02-10 23:52:03 +05:30
index.js Fixes OPF file format and cover URLs 2020-02-11 00:16:06 +05:30
openlibrary.js xmlbuilder upgrade fixed some things 2021-05-11 12:44:42 +05:30
package-lock.json Bump ansi-regex from 5.0.0 to 5.0.1 2022-05-30 14:47:02 +05:30
package.json Version bump 2021-07-09 14:11:21 +05:30
test.js xmlbuilder upgrade fixed some things 2021-05-11 12:44:42 +05:30


Generates a metadata.xml file for an EPUB from various online sources, given a few identifiers.

Currently supports the following providers:

Provider Input
OpenLibrary ISBN


You can install it from NPM

npm i -g epub-metadata-generator


You can use the provided command-line-executable:

generate-epub-xml 9780596101190 /tmp/9780596101190.xml
cat /tmp/9780596101190.xml
<?xml version="1.0"?>
  <dc:identifier opf:scheme="ISBN-13">9780596101190</dc:identifier>
  <dc:identifier opf:scheme="ISBN-10">0596101198</dc:identifier>
  <dc:creator opf:role="aut">Dan Woods</dc:creator>
  <dc:creator opf:role="aut">Gautam Guliani</dc:creator>
  <dc:title id="title">Open Source for the Enterprise</dc:title>
  <dc:title id="subtitle">Managing Risks, Reaping Rewards</dc:title>
  <meta refines="#subtitle" property="title-type">subtitle</meta>
  <dc:publisher>O'Reilly Media, Inc.</dc:publisher>

You can use this file in pandoc directly:

pandoc input.html --epub-metadata=/tmp/9780596101190.xml file.epub

Alternatively, you can use the NPM package programatically as well:

const E = require('epub-metadata-generator')
E.write(filepath, ISBN);


Licensed under the MIT License. See LICENSE file for details.


Some of the code in openlibrary.js is based on the node-isbn-catalogue package, which was based on palmerabollo/node-isbn. Both are under AGPL.