2.2.4 • Published 5 years ago

ircra v2.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

IRCRA

WARNING

Some grade types do not match 1:1 with other grade types during conversion. Currently the first found match is returned.

Supported Grade Systems

Gender, Vermin, Font, IRCRA, YDS, French/Sport, British, Tech, Ewbank, BRZ, UIAA, Metric UIAA, Watts

Grade System Types

nametype
male (level)number
female (level)number
verminstring
fontstring
ircranumber
ydsstring
sportstring
britishstring
techstring
ewbanknumber
brzstring
uiaastring
uiaa_metricnumber
wattsnumber

Description

Tiny Library for converting values between different climbing route grade systems.

Installation

npm install ircra

Usage

Example

import IRCRA from 'ircra'

const ircra = new IRCRA()
const test = ircra.convert('yds', '5.3').to('vermin')

console.log(test) // {vermin:null}

Methods

get

console.log(
    new IRCRA().get('yds')
) // [...]

The get method generates an index for the chosen grade system, and returns a new object for that type. It takes an optional parameter of gradeSystem. If no argument is provided, all grades in all grade systems are returned.

console.log(
    new IRCRA().get()
) // [{...}]

convert

console.log(
    new IRCRA().convert('yds', '5.1').to('vermin')
) // {...}

The convert method takes two parameters. The gradeSystem and gradeValue. It returns an object with a to method that takes one parameter, the target gradeSystem.

It will then return an object with the new gradeSystem value.

scale

console.log(
    new IRCRA().scale()
) // [{...}, {...}...]

The scale method returns a list of possible scale values with human-readable values associated with their respective internal ids.

Efficiency

Since this package loads the climbing grade version directly at runtime, attempts are made to make the queries / conversions more efficient.

When you call .get with a type. An index (Map) is generated in memory, and used for the conversions to other types.

The first .get call is benchmarked at around .2ms, but subsequent get/convert calls come in at around 0.002ms.

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

1.0.0

6 years ago