# chord-mark

> ChordMark - chord charts parser and renderer

Latest version **0.18.0** (published 2026-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install chord-mark
pnpm add chord-mark
yarn add chord-mark
bun add chord-mark
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.18.0 |
| Published | 2026-07-13 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.0 |
| Dependencies | 3 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 95 |
| Author | Christophe Noël |
| Maintainers | touffi |

## Links

- npm: https://www.npmjs.com/package/chord-mark
- Repository: https://github.com/no-chris/chord-mark
- Homepage: https://github.com/no-chris/chord-mark/tree/main/packages/chord-mark#readme
- Issues: https://github.com/no-chris/chord-mark/issues
- npm.io page: https://npm.io/package/chord-mark

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.23
- [dompurify](https://npm.io/package/dompurify.md) ^3.3.3
- [chord-symbol](https://npm.io/package/chord-symbol.md) 4.0.0

## Recent versions

- 0.18.0 (latest) — 2026-07-13
- 0.13.0-beta.6 (next) — 2023-02-11
- 0.17.0 — 2024-09-08
- 0.16.3 — 2024-08-25
- 0.16.2 — 2024-01-27
- 0.16.1 — 2024-01-27
- 0.16.0 — 2023-12-24
- 0.15.0 — 2023-11-29
- 0.14.0 — 2023-02-26
- 0.13.0 — 2023-02-14
- 0.13.0-beta.5 — 2023-02-10
- 0.13.0-beta.4 — 2023-02-09
- 0.13.0-beta.3 — 2023-01-26
- 0.13.0-beta.2 — 2023-01-18
- 0.13.0-beta.1 — 2023-01-17
- … 26 more at https://npm.io/package/chord-mark/versions

## README

# ChordMark

## Installation

```shell
yarn add chord-mark chord-mark-themes
```

## Usage

```javascript
import { parseSong, renderSong } from 'chord-mark/lib/chord-mark.js';

const song = 'C.. G..\n' + 'When I _find myself in _times of trouble';

const parsed = parseSong(song);
const rendered = renderSong(parsed);
```

ChordMark's default renderer produces a string containing an HTML markup.

```html
<div class="cmSong">
	<p class="cmLine">
		<span class="cmChordLine"
			><span class="cmChordLineOffset"> </span
			><span class="cmBarSeparator">|</span
			><span class="cmChordSymbol">C</span>
			<span class="cmChordSymbol">G</span>
			<span class="cmBarSeparator">|</span></span
		>
	</p>
	<p class="cmLine">
		<span class="cmLyricLine">When I find myself in times of trouble</span>
	</p>
</div>
```

## Configuration

The renderer function can be configured.
Until proper documentation is available, the list of parameters can be checked here: https://github.com/no-chris/chord-mark/blob/master/packages/chord-mark/src/renderer/components/renderSong.js#L27

## Documentation

Check the [User Guide](https://chordmark.netlify.app).

## CSS Classes

By default, ChordMark does not come with any CSS styling.
You can either use the `chord-mark-themes` module or design your own themes.
The following list of CSS classes are available:

- `cmSong`
- `cmSection`
- `cmSection-xxx`, where `xxx` is the section name
- `cmLine`
- `cmLine--isFromAutoRepeatChords`
- `cmLine--isFromChordLineRepeater`
- `cmLine--isFromSectionCopy`
- `cmLine--isFromSectionMultiply`
- `cmChordLine`
- `cmChordLineOffset`
- `cmBarSeparator`
- `cmChordSymbol`
- `cmChordDuration`
- `cmEmptyLine`
- `cmLyricLine`
- `cmSectionLabel`
- `cmSectionMultiplier`
- `cmTimeSignature`
- `cmSubBeatGroupOpener`
- `cmSubBeatGroupCloser`

## Breaking changes

While I don't foresee the public API to change drastically in the future, it is to be considered unstable until `v1.0.0` is published.
Breaking changes might happen until then and will be documented in the release notes.

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