

What is this?
Javascript utilities for working with rock climbing grades.
Supported systems
Sport & Traditional climbing
Bouldering
Aid
Ice
Help Wanted
Code contributions are most welcome!
Questions?
Join us on Discord.
How to use the library
Install the package
Using NPM
npm install @openbeta/sandbag
Using Yarn
yarn add @openbeta/sandbag
Sample Usage
import { French, YosemiteDecimal } from '@openbeta/sandbag'
const score = French.getScore('8a')
const slashGradeScore=French.getScore('7c+/8a')
const plusGrade= YosemiteDecimal.getScore('5.12+')
import { Font } from '@openbeta/sandbag'
Font.getGrade(80)
Font.getGrade([79,81])
import { VScale , Font }from '@openbeta/sandbag'
console.log('Is 6A a V Scale?',VScale.isType('6A'))
console.log('Is 6A a Font Scale?',Font.isType('6A'))
- Convert Grades Across Scales
import {convertGrade , GradeScales }from '@openbeta/sandbag'
const ydsInFrench=convertGrade('5.11a',GradeScales.YDS,GradeScales.FRENCH)
const fontInVScale=convertGrade('6a',GradeScales.FONT,GradeScales.VSCALE)
const sportToBoulder=convertGrade('5.11a',GradeScales.YDS,GradeScales.VSCALE)
import { Ewbank } from '@openbeta/sandbag'
Ewbank.getGradeBand('10')
Ewbank.getGradeBand('30')
Ewbank.getGradeBand('6a')
import { French, YosemiteDecimal } from '@openbeta/sandbag'
const harder = French.getScore('8a')
const easier = YosemiteDecimal.getScore('5.13a')
console.log('Is 8a harder than 5.13a?',harder > easier)
See unit tests for more examples.
Development (TBD)
yarn install
yarn test
Generating Test Coverage Report
To generate a test coverage report using Jest run the following command in your terminal:
npx jest --coverage
If you're using macOS, you can directly access the coverage report in your browser by opening the following URL:
file:///Users/<userName>/sandbag/coverage/lcov-report/index.html
How to publish a new release to NPM
Submit a PR with commit message [npm publish]
Project Maintainers
License
MIT
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!