# ssmd

> Speech Synthesis Markdown (SSMD) is a lightweight alternative syntax for Speech Synthesis Markup Language (SSML)

Latest version **1.0.8** (published 2025-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install ssmd
pnpm add ssmd
yarn add ssmd
bun add ssmd
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2025-02-15 |
| First published | 2018-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 22.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fabien Lenoir |
| Maintainers | fabien88 |
| Keywords | SSMD, SSML, markdown |

## Links

- npm: https://www.npmjs.com/package/ssmd
- Repository: https://github.com/fabien88/ssmd
- Homepage: https://github.com/fabien88/ssmd#readme
- Issues: https://github.com/fabien88/ssmd/issues
- npm.io page: https://npm.io/package/ssmd

## Dependencies (5)

- [ramda](https://npm.io/package/ramda.md) ^0.26.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [ssml-builder](https://npm.io/package/ssml-builder.md) ^0.4.3
- [xml-formatter](https://npm.io/package/xml-formatter.md) ^1.1.0
- [simple-text-parser](https://npm.io/package/simple-text-parser.md) ^2.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.8 (latest) — 2025-02-15
- 1.0.7 — 2020-06-27
- 1.0.6 — 2020-06-26
- 1.0.5 — 2020-04-20
- 1.0.4 — 2019-06-25
- 1.0.3 — 2019-06-18
- 1.0.2 — 2019-06-17
- 1.0.1 — 2018-09-23
- 1.0.0 — 2018-09-23

## README

# SSMD

[![Build Status](https://travis-ci.org/fabien88/ssmd.svg?branch=master)](https://travis-ci.org/fabien88/ssmd)

Speech Synthesis Markdown (SSMD) is a lightweight alternative syntax for [SSML](https://www.w3.org/TR/speech-synthesis/).
It's a node port of [ruby ssmd](https://github.com/machisuji/ssmd)

See [specification](SPECIFICATION.md) of the language.

## Requirements

Node 8 or later

## Installation

```js
npm install ssmd
```

## Usage

```js
const ssmd = require('ssmd');

const ssml = ssmd("hello *SSMD*!");

console.log(ssml);

```

```xml
<speak>
    hello <emphasis>SSMD</emphasis>!
</speak>
```

## Options

```js
const config = {
  outputSpeakTag: false, 
  prettyPrint: true,
  headingLevels: { 
    1: [{
        tag: "emphasis",
        value: 'strong'
      },
      {
        tag: "pause",
        value: '300ms'
      },
    ]
   }
};

ssmd(`
  # My first heading 1
  Hello world
  `,
  config
)
```

```xml
  <s>
     <emphasis level='strong'>
       My first heading 1
     </emphasis> 
     <break time=\'300ms\'/>
  </s>
  <s>
    Hello world
  </s>
```

- `outputSpeakTag` (Boolean, default=`true`) Set it to false if you don't want to have <speak></speak> tags included.
- `prettyPrint` (String, default=`true`) Indent the resulting ssml.
- `headingLevels` (Object) Customize the way heading tags will be transformed into SSML, default value is specified in [specification.md](SPECIFICATION.md#headings)

**Note:**

This version is still under development. See below which essential SSML constructs are implemented so far:

- [x] Text
- [x] Emphasis
- [x] Break
- [ ] Language
- [ ] Mark
- [x] Paragraph
- [x] Sentence
- [ ] Phoneme
- [x] Prosody
- [x] Say-as
- [ ] Substitution
- [x] Audio
- [ ] Extensions

### Tests

Run `npm test` to run the tests against a given executable.

This implementation and any other can be tested against the SSMD specification.
Said specification is extracted from `SPECIFICATION.md`.
It runs each SSMD snippet through the tested tool and compares it to the output of
the following SSML snippet. If they match the test passes.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fabien88/ssmd. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The module is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

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