Compare commits

...

17 Commits

Author SHA1 Message Date
dependabot[bot] f56e5b4538 Bump word-wrap from 1.2.3 to 1.2.5
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 15:03:12 +05:30
dependabot[bot] df1f0e5519 Bump json5 from 2.2.0 to 2.2.3
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 14:54:31 +05:30
dependabot[bot] f64a58dd11 Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 14:54:22 +05:30
Nemo 105dad2f76
Create FUNDING.yml 2022-05-30 14:47:54 +05:30
dependabot[bot] 65087cf083 Bump ansi-regex from 5.0.0 to 5.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-30 14:47:02 +05:30
dependabot[bot] aeb21d887d Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 10:49:47 +05:30
Nemo ec95b9e5df Version bump 2021-07-09 14:11:21 +05:30
Nemo ac1d2c198a dep update 2021-07-09 14:10:42 +05:30
Nemo cafbe67004 Adds npmignore 2021-05-11 12:45:21 +05:30
Nemo 668463c1c9 xmlbuilder upgrade fixed some things 2021-05-11 12:44:42 +05:30
Nemo a878151b1c [license] Adds copy of LICENSE text 2021-05-11 12:44:18 +05:30
Nemo 72844fdb0f [deps] Dependency updates 2021-05-11 12:43:48 +05:30
dependabot[bot] b10bf7fa50 Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 07:05:17 +00:00
dependabot[bot] 2b3ef776ee Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 17:21:36 +00:00
dependabot[bot] 29134b4382 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-03 14:09:08 +05:30
dependabot[bot] d458bcddeb Bump acorn from 6.4.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-09 01:50:43 +05:30
Nemo 95ec206bda Improves README 2020-02-19 21:14:48 +05:30
8 changed files with 5354 additions and 2811 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
ko_fi: captn3m0
liberapay: captn3m0
github: captn3m0

2
.npmignore Normal file
View File

@ -0,0 +1,2 @@
.editorconfig
test.js

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright 2021 Abhay Rana
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -8,14 +8,17 @@ Currently supports the following providers:
|--------|-----|
|OpenLibrary|ISBN|
## Usage
## Installation
```javascript
const E = require('epub-metadata-generator')
E.write(filepath, ISBN);
You can install it from NPM
```
npm i -g epub-metadata-generator
```
Alternatively, you can use the provided command-line-executable:
## Usage
You can use the provided command-line-executable:
```sh
generate-epub-xml 9780596101190 /tmp/9780596101190.xml
@ -41,6 +44,13 @@ 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:
```javascript
const E = require('epub-metadata-generator')
E.write(filepath, ISBN);
```
## License
Licensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details.

View File

@ -48,8 +48,6 @@ module.exports = {
});
}
console.log(JSON.stringify(book.details));
if (undefined !== book.details.covers) {
let coverId = book.details.covers[0];

8123
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "epub-metadata-generator",
"version": "1.0.0",
"version": "1.0.2",
"description": "Generates EPUB metadata files from various sources",
"main": "index.js",
"scripts": {
@ -18,10 +18,10 @@
"license": "MIT",
"dependencies": {
"node-isbn-catalogue": "^1.2.3",
"xmlbuilder": "^13.0.2"
"xmlbuilder": "^15.1.1"
},
"devDependencies": {
"jest": "^25.1.0"
"jest": "^27.0.6"
},
"bin": {
"generate-epub-xml": "./cli.js"

View File

@ -34,6 +34,6 @@ test("the xml generator to work", () => {
};
let xml = generator._convert(input, false);
expect(xml).toBe(
`<?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>`
`<?xml version="1.0"?><package unique-identifier="uuid_id" xmlns="http://www.idpf.org/2007/opf"><metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/"><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><dc:date>2005-07-26</dc:date></metadata></package>`
);
});