# retext-syllable

> Count syllables in Retext

Latest version **1.0.0** (published 2015-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install retext-syllable
pnpm add retext-syllable
yarn add retext-syllable
bun add retext-syllable
```

## 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.0.0 |
| Published | 2015-08-04 |
| First published | 2014-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Titus Wormer |
| Maintainers | wooorm |
| Keywords | syllable, retext |

## Links

- npm: https://www.npmjs.com/package/retext-syllable
- Repository: https://github.com/wooorm/retext-syllable
- Homepage: https://github.com/wooorm/retext-syllable#readme
- Issues: https://github.com/wooorm/retext-syllable/issues
- npm.io page: https://npm.io/package/retext-syllable

## Dependencies (3)

- [syllable](https://npm.io/package/syllable.md) ^0.1.4
- [nlcst-to-string](https://npm.io/package/nlcst-to-string.md) ^0.1.5
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2015-08-04
- 0.1.6 — 2015-01-19
- 0.1.5 — 2014-12-08
- 0.1.4 — 2014-11-21
- 0.1.3 — 2014-10-28
- 0.1.2 — 2014-10-21
- 0.1.1 — 2014-10-15
- 0.1.0 — 2014-09-27
- 0.0.1 — 2014-09-15

## README

# retext-syllable [![Build Status](https://img.shields.io/travis/wooorm/retext-syllable.svg)](https://travis-ci.org/wooorm/retext-syllable) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/retext-syllable.svg)](https://codecov.io/github/wooorm/retext-syllable)

Count syllables with [**retext**](https://github.com/wooorm/retext).

## Installation

[npm](https://docs.npmjs.com/cli/install):

```bash
npm install retext-syllable
```

**retext-syllable** is also available for [bower](http://bower.io/#install-packages),
[component](https://github.com/componentjs/component), and
[duo](http://duojs.org/#getting-started), and as an AMD, CommonJS, and globals
module, [uncompressed](retext-syllable.js) and
[compressed](retext-syllable.min.js).

## Usage

```js
var retext = require('retext');
var inspect = require('unist-util-inspect');
var syllable = require('retext-syllable');

retext().use(syllable).use(function () {
    return function (cst) {
        console.log(inspect(cst));
    };
}).process('A yellow fresh banana.');
```

Yields:

```text
RootNode[1] [data={"syllableCount":7}]
└─ ParagraphNode[1] [data={"syllableCount":7}]
   └─ SentenceNode[8] [data={"syllableCount":7}]
      ├─ WordNode[1] [data={"syllableCount":1}]
      │  └─ TextNode: 'A'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[1] [data={"syllableCount":2}]
      │  └─ TextNode: 'yellow'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[1] [data={"syllableCount":1}]
      │  └─ TextNode: 'fresh'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[1] [data={"syllableCount":3}]
      │  └─ TextNode: 'banana'
      └─ PunctuationNode: '.'
```

## API

None, **retext-syllable** automatically detects the syllables of each
[`WordNode`](https://github.com/wooorm/nlcst#wordnode) (using
[**wooorm/syllable**](https://github.com/wooorm/syllable)), and stores the
count in `node.data.syllableCount`.

All parents (such as  sentences, paragraphs, root) also receive a
`syllableCount` property (`parent.data.syllableCount`).

## License

[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)

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