New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tonal-roman-numeral

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonal-roman-numeral

Work with roman numeral representation of degrees

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
878
decreased by-23.25%
Maintainers
1
Weekly downloads
 
Created
Source

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

TypeDescription
Stringthe 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

ParamTypeDefault
[isMajor]booleantrue

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

ParamType
nameString

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

ParamType
nameString

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

ParamTypeDescription
namestring | numberroman numeral name (with optional type)

Example

decimal("IVmaj7"); // => 4
decimal(4); // => 4
decimal(10); // => null

RomanNumeral.degree(degree, [isMajor])String

Get a degree in roman numeral

Kind: static method of RomanNumeral

ParamTypeDefault
degreenumber
[isMajor]booleantrue

Example

degree(2); // => "II"
degree(2, false); // => "ii"

Keywords

FAQs

Package last updated on 14 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc