Registry / productivity / prjesus12dev-tonality

prjesus12dev-tonality

JSON →
library1.2.2jsnpmunverified

A JavaScript chord parser and formatter with TypeScript support. Version 1.2.2 provides utilities to parse chord strings (e.g., 'Cmaj7') into structured objects and format chord objects back to strings. Offers a simple API for music theory applications. No current release cadence information available. Differentiates itself by focusing on parsing and formatting rather than generation or playback.

npm install prjesus12dev-tonality
INSTALL
IMPORT
SIG · PRJESUS12DEV-TONAL
P
prjesus12dev-tonality
productivityjavascriptv1.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parseChord
import { parseChord } from 'prjesus12dev-tonality'
import parseChord from 'prjesus12dev-tonality'
function is a named export, not default.
formatChord
import { formatChord } from 'prjesus12dev-tonality'
const formatChord = require('prjesus12dev-tonality').formatChord
package is ESM-only; require will fail.
Chord
import type { Chord } from 'prjesus12dev-tonality'
import { Chord } from 'prjesus12dev-tonality'
Chord is a TypeScript type, not a runtime value.

Parses a chord string into a structured object and formats a chord object back to a string.

import { parseChord, formatChord } from 'prjesus12dev-tonality'; const parsed = parseChord('Cmaj7'); console.log(parsed); // { root: 'C', quality: 'major', extension: '7' } const formatted = formatChord({ root: 'D', quality: 'minor', extension: '7' }); console.log(formatted); // 'Dm7'
Debug
Known issues
gotchaparseChord may not accept all chord symbols (e.g., sus, add). Test with your input.
fix
Check the package source for supported chord types.
affects: >=1.0.0
gotchaformatChord expects root to be a single letter (A-G). Sharp/flat roots are not supported.
fix
Input root as 'C#' or 'Bb' may cause errors; use enharmonic equivalents like 'Db'.
affects: >=1.0.0
deprecatedThe package has not been updated since 2022; consider it low maintenance.
fix
Search for more actively maintained alternatives.
affects: ~1.2.2
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Using ESM import in a CommonJS context.
fix
Add "type": "module" to your package.json or use dynamic import().
TypeError: (0 , _tonality.parseChord) is not a function
Using require() with an ESM-only package.
fix
Switch to import syntax or use a dynamic import: import('prjesus12dev-tonality').then(m => m.parseChord(...))
Conversion of type '{ root: string; quality: string; extension: string; }' to type 'Chord' may be a mistake because neither type sufficiently overlaps with the other.
Mismatch between parsed shape and type definition.
fix
Check the actual shape returned by parseChord and align your interface.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
prjesus12dev-tonality — npm install prjesus12dev-tonality · libregistry