npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@musodojo/music-theory-data

v20.4.0

Published

The musician-friendly TypeScript library for scales, modes, chords, and arpeggios.

Readme

Muso Dojo | Music Theory Data

Empower your music applications with a comprehensive, type-safe, and musician-friendly TypeScript/JavaScript library for modes, scales, chords, and more.

Community & Support

Have a question, a suggestion, or want to report a bug? Get in touch!

Available Note Collections

  • ✅ Diatonic Modes
  • ✅ Pentatonic Variants
  • ✅ Major Variants
  • ✅ Minor Variants
  • ✅ Dominant Variants
  • ✅ Harmonic Minor Modes
  • ✅ Melodic Minor Modes
  • ✅ Diminished Variants
  • ✅ Augmented Variants
  • ✅ Other Note Collections

Features

  • Fully Typed: Written in TypeScript with comprehensive type definitions for a great developer experience.
  • Deno First, NPM Ready: A modern Deno module that is also published to npm for use in Node.js projects.

Rich Data Structures

Access detailed information for scales, modes, chords, and more, including intervals, integer notations, and common names.

// src/data/note-collections/diatonic-modes.ts
// @ts-ignore
const ionian: ModalScaleCollection = {
  category: "scale",
  rotation: 0,
  parentScale: "ionian",
  primaryName: "Major",
  names: ["Major", "Ionian", "Major Scale", "Ionian Mode", "Diatonic Major"],
  intervals: ["1", "2", "3", "4", "5", "6", "7", "8"],
  integers: [0, 2, 4, 5, 7, 9, 11],
  type: [
    "major",
    "ionian",
    "mode",
    "scale",
    "church mode",
    "diatonic mode",
    "heptatonic",
    "first diatonic mode",
    "do mode",
  ],
  characteristics: [
    "bright",
    "happy",
    "stable",
    "uplifting",
    "consonant",
    "western",
    "foundational",
    "simple",
    "pop music",
    "major tonality",
    "commonly used western scale",
  ],
  pattern: ["whole", "whole", "half", "whole", "whole", "whole", "half"],
  patternShort: ["W", "W", "H", "W", "W", "W", "H"],
} as const;

Practical Utility Functions

Helpers for common tasks like generating note names from a root note and a set of intervals. For the full implementation details, refer to the source file.

export function getNoteNamesFromRootAndIntervals(
  // @ts-ignore
  rootNote: RootNote,
  intervals: readonly Interval[],
  options: TransformIntervalsOptions = {},
): NoteName[] {
  // This is a simplified representation for documentation purposes.
  // The actual implementation is in src/utils/note-names.ts
  return [];
}

Installation

Deno / JSR

Install the package from the JSR registry:

deno add jsr:@musodojo/music-theory-data

Then import it into your project:

import * as music_theory_data from "@musodojo/music-theory-data";

Node.js / npm

Install the package from the npm registry:

npm install @musodojo/music-theory-data

Then import it into your project:

import * as music_theory_data from "@musodojo/music-theory-data";

Usage Examples

Note: the tests/ directory contains many useful examples.

The code below shows how to access and print some of the data.

import * as music_theory_data from "jsr:@musodojo/music-theory-data";

// Get the notes of A Harmonic Minor
const notes1 = music_theory_data.getNoteNamesFromRootAndCollectionKey(
  "A",
  "harmonicMinor",
);
console.log(notes1);
// ["A", "B", "C", "D", "E", "F", "G♯", "A"]

// Automatically knows whether to use flats or sharps
const notes2 = music_theory_data.getNoteNamesFromRootAndCollectionKey(
  "F",
  "ionian",
);
console.log(notes2);
//  ["F", "G", "A", "B♭", "C", "D", "E", "F"];

// Get the full data structure for the Ionian mode (Major Scale)
const ionian = music_theory_data.noteCollections.ionian;

console.log(ionian.primaryName);
// "Major"

console.log(ionian.intervals);
// ["1", "2", "3", "4", "5", "6", "7", "8"]

// Log an array of all available Note Collection Keys
console.log(Object.keys(music_theory_data.noteCollections));
// ["ionian", "dorian", "phrygian", ...]

// Log an array of all available Grouped Note Collections Keys
console.log(Object.keys(music_theory_data.groupedNoteCollections));
// ["diatonicModes", "pentatonicVariants", ...]

API Documentation

For a full list of all available data, types, and utility functions, please see the auto-generated API documentation on JSR.