JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q59310F
  • License Apache-2.0

Chord parser and printer

Package Exports

  • momo-chords

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (momo-chords) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

momo-chords

Chord parser and printer.

NPM Version Build Status TypeScript

Try it on the demo page!

Overview

There are many existing libraries that tackle handling chords. However, they either don't support a large enough set of chords, or they lack functionality, or they are not properly configurable, or they don't come with types.

The goal of this library is to support all of the above.

Currently it supports:

  • A very large set of chords
  • Parsing strings as chords
  • Printing chord names when given a chord
  • An even larger set of chords
  • Configurable naming strategies
  • Autocomplete/search by name

Installation

npm install --save momo-chords

or

yarn add momo-chords

Usage

import { Chords } from "momo-chords";

const chords = new Chords();

// Check if a string is a valid chord anme
chords.isChord("A#maj7/G");  // true
chords.isChord("T");  // false

// Parse a string into a chord object
const chord = chords.parse("A#M7/G");  // chord object

// Print the name of a chord
chords.print(chord);  // "A#maj7/G"