# epub-hyphen

> Hyphenate text nodes in epub or stand-alone xhtml files

Latest version **1.2.0** (published 2022-12-27) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install epub-hyphen
pnpm add epub-hyphen
yarn add epub-hyphen
bun add epub-hyphen
```

Provides the command `epub-hyphen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-12-27 |
| First published | 2017-05-30 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 40 |
| Unpacked size | 48.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Alexander Gromnitsky |
| Maintainers | gromnitsky |
| Keywords | epub, hyphen, hyphenate, xhtml |

## Links

- npm: https://www.npmjs.com/package/epub-hyphen
- Repository: https://github.com/gromnitsky/epub-hyphen
- Homepage: https://github.com/gromnitsky/epub-hyphen#readme
- Issues: https://github.com/gromnitsky/epub-hyphen/issues
- npm.io page: https://npm.io/package/epub-hyphen

## Dependencies (40)

- [xamel](https://npm.io/package/xamel.md) ~0.3.1
- [hypher](https://npm.io/package/hypher.md) ~0.2.5
- [commander](https://npm.io/package/commander.md) ~9.4.1
- [hyphenation.be](https://npm.io/package/hyphenation.be.md) ~0.2.1
- [hyphenation.bn](https://npm.io/package/hyphenation.bn.md) ~0.2.1
- [hyphenation.ca](https://npm.io/package/hyphenation.ca.md) ~0.2.1
- [hyphenation.cs](https://npm.io/package/hyphenation.cs.md) ~0.2.1
- [hyphenation.da](https://npm.io/package/hyphenation.da.md) ~0.2.1
- [hyphenation.de](https://npm.io/package/hyphenation.de.md) ~0.2.1
- [hyphenation.es](https://npm.io/package/hyphenation.es.md) ~0.2.1
- [hyphenation.fi](https://npm.io/package/hyphenation.fi.md) ~0.2.1
- [hyphenation.fr](https://npm.io/package/hyphenation.fr.md) ~0.2.1
- [hyphenation.gu](https://npm.io/package/hyphenation.gu.md) ~0.2.1
- [hyphenation.hi](https://npm.io/package/hyphenation.hi.md) ~0.2.1
- [hyphenation.hu](https://npm.io/package/hyphenation.hu.md) ~0.2.1
- [hyphenation.hy](https://npm.io/package/hyphenation.hy.md) ~0.2.1
- [hyphenation.it](https://npm.io/package/hyphenation.it.md) ~0.2.1
- [hyphenation.kn](https://npm.io/package/hyphenation.kn.md) ~0.2.1
- [hyphenation.la](https://npm.io/package/hyphenation.la.md) ~0.2.1
- [hyphenation.lt](https://npm.io/package/hyphenation.lt.md) ~0.2.1
- [hyphenation.lv](https://npm.io/package/hyphenation.lv.md) ~0.2.1
- [hyphenation.ml](https://npm.io/package/hyphenation.ml.md) ~0.2.1
- [hyphenation.nl](https://npm.io/package/hyphenation.nl.md) ~0.2.1
- [hyphenation.or](https://npm.io/package/hyphenation.or.md) ~0.2.1
- [hyphenation.pa](https://npm.io/package/hyphenation.pa.md) ~0.2.1
- [hyphenation.pl](https://npm.io/package/hyphenation.pl.md) ~0.2.1
- [hyphenation.pt](https://npm.io/package/hyphenation.pt.md) ~0.2.1
- [hyphenation.sk](https://npm.io/package/hyphenation.sk.md) ~0.2.1
- [hyphenation.sl](https://npm.io/package/hyphenation.sl.md) ~0.2.1
- [hyphenation.sv](https://npm.io/package/hyphenation.sv.md) ~0.2.1
- [hyphenation.ta](https://npm.io/package/hyphenation.ta.md) ~0.2.1
- [hyphenation.te](https://npm.io/package/hyphenation.te.md) ~0.2.1
- [hyphenation.tr](https://npm.io/package/hyphenation.tr.md) ~0.2.1
- [hyphenation.uk](https://npm.io/package/hyphenation.uk.md) ~0.2.1
- [hyphenation.grc](https://npm.io/package/hyphenation.grc.md) ~0.2.1
- [hyphenation.en-gb](https://npm.io/package/hyphenation.en-gb.md) ~0.2.1
- [hyphenation.en-us](https://npm.io/package/hyphenation.en-us.md) ~0.2.1
- [hyphenation.nb-no](https://npm.io/package/hyphenation.nb-no.md) ~0.2.1
- [hyphenation.el-monoton](https://npm.io/package/hyphenation.el-monoton.md) ~0.2.1
- [hyphenation.el-polyton](https://npm.io/package/hyphenation.el-polyton.md) ~0.2.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2022-12-27
- 1.1.0 — 2022-12-16
- 1.0.0 — 2022-12-15
- 0.0.6 — 2017-09-22
- 0.0.5 — 2017-05-30

## README

$ npm i -g epub-hyphen

Reqs:

* node 18.x
* `zip` & `unzip` in PATH

## Usage

~~~
$ ./epub-hyphen -h
Usage: epub-hyphen [options] input [-o output]

Hyphenate text nodes in epub or stand-alone xhtml files

Options:
  -V, --version        output the version number
  -l <str>             a 2-letter default language in case <html lang='xx'>
                       attribute is absent; this does NOT override already
                       present lang= attributes
  -i <str>             an additional comma-separated list of tags to ignore; a
                       tag can optionally include a class name, e.g. `h1,p.foo`
  -o <str>             an output file name (overwrite the contents)
  --lang-list          print all supported languages
  --ignored-tags-list  print the default ignored tags list
  -h, --help           display help for command

set NODE_DEBUG=epub-hyphen to enable debug log
~~~

When converting epubs:

* if no `-l` is given, the program tries to detect the
  default language from epub metadata;
* always use `-o` in Windows.

## Examples

~~~
$ echo '<p>дихлордифенілтрихлорметилметан</p>' | ./epub-hyphen -l uk
<?xml version="1.0"?>
<p>ди-хлор-ди-фе-ніл-три-хлор-ме-тил-ме-тан</p>
~~~

The contents of some tags is never hyphenated (`code`, `pre`, &c):

~~~
$ echo '<p><code>foobar</code>foobar</p>' | ./epub-hyphen
<?xml version='1.0' encoding='utf-8'?>
<p><code>foobar</code>foo-bar</p>
~~~

Hyphenate a epub:

    $ ./epub-hyphen test/data/1.epub > 2.epub

## Bugs

* No mappings the between internal lang names & BCP 47.
* An empty .x?html file is treated as an invalid xml.

## News

v1.0.0 is a complete rewrite; its cli is incompatible with 0.0.x
versions.

---
_Source: https://npm.io/package/epub-hyphen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
