Generates a metadata.xml file for an EPUB from various online sources, can be used with pandoc
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Go to file
Nemo 105dad2f76
Create FUNDING.yml
10 months ago
.github Create FUNDING.yml 10 months ago
.editorconfig Initial Commit 💥 3 years ago
.gitignore Initial Commit 💥 3 years ago
.npmignore Adds npmignore 2 years ago
LICENSE [license] Adds copy of LICENSE text 2 years ago
README.md Improves README 3 years ago
cli.js Fixes date and cover 3 years ago
index.js Fixes OPF file format and cover URLs 3 years ago
openlibrary.js xmlbuilder upgrade fixed some things 2 years ago
package-lock.json Bump ansi-regex from 5.0.0 to 5.0.1 10 months ago
package.json Version bump 2 years ago
test.js xmlbuilder upgrade fixed some things 2 years ago

README.md

epub-metadata-generator

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

Installation

You can install it from NPM

npm i -g epub-metadata-generator

Usage

You can use the provided command-line-executable:

generate-epub-xml 9780596101190 /tmp/9780596101190.xml
cat /tmp/9780596101190.xml
<?xml version="1.0"?>
<metadata>
  <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:language>eng</dc:language>
  <dc:publisher>O'Reilly Media, Inc.</dc:publisher>
</metadata>

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);

License

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

Credits

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.