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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tonal-roman-numeral

v2.2.2

Published

Work with roman numeral representation of degrees

Downloads

7,825

Readme

RomanNumeral

npm version tonal

tonal-roman-numeral is a collection of functions to query about tonal keys.

This is part of tonal music theory library.

Example

// es6
import * as RomanNumeral from "tonal-roman-numeral"
// es5
const RomanNumeral = require("tonal-roman-numeral")

Example

RomanNumeral.names() // => ["I", "II", "III", "IV", "V", "VI", "VII"]
RomanNumeral.props('ii7') // => { name: 'ii', type: '7', num: 2, major: false }
RomanNumeral.degree(2) // => "II"
RomanNumeral.degree(2, false) // => "ii"

RomanNumeral.props()Object

Get properties of a roman numeral string

Kind: static method of RomanNumeral
Returns: Object - - the roman numeral properties

| Type | Description | | --- | --- | | string | the roman numeral string (can have type, like: Imaj7) |

Example

props("VIIb5") // => { name: "VII", type: "b5", num: 7, major: true }

RomanNumeral.names([isMajor])Array.<String>

Get roman numeral names

Kind: static method of RomanNumeral

| Param | Type | Default | | --- | --- | --- | | [isMajor] | boolean | true |

Example

names() // => ["I", "II", "III", "IV", "V", "VI", "VII"]
names(false) // => ["i", "ii", "iii", "iv", "v", "vi", "vii"]

RomanNumeral.name(name)string

Get roman numeral name of a string or null if not valid roman numeral

Kind: static method of RomanNumeral

| Param | Type | | --- | --- | | name | string |

Example

name('IIb7') // => 'II
name('iii') // => 'iii'
name('Ii') // => null (mixed case not allowed)

RomanNumeral.type(name)string

Get type of a roman numeral

Kind: static method of RomanNumeral

| Param | Type | | --- | --- | | name | string |

Example

type('Imaj7') // => 'maj7'

RomanNumeral.decimal(name)number

Get roman numeral number in decimal integer (it accepts numbers from 1 to 7)

Kind: static method of RomanNumeral

| Param | Type | Description | | --- | --- | --- | | name | string | number | roman numeral name (with optional type) |

Example

decimal('IVmaj7') // => 4
decimal(4) // => 4
decimal(10) // => null

RomanNumeral.fromDegree(degree, [isMajor])string

Get a roman numeral from a degree number

Kind: static method of RomanNumeral
Returns: string - the roman numeral

| Param | Type | Default | | --- | --- | --- | | degree | number | | | [isMajor] | boolean | true |

Example

fromDegree(2) // => "II"
fromDegree(2, false) // => "ii"