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

@openbeta/sandbag

v0.0.51

Published

Rock climbing grades and conversions

Downloads

190

Readme

Develop branch License

All Contributors

What is this?

Javascript utilities for working with rock climbing grades.

Supported systems

Sport & Traditional climbing

  • [x] Yosemite Decimal System
  • [x] French
  • [x] UIAA
  • [x] Ewbanks
  • [x] Saxon
  • [x] Brazilian

Bouldering

  • [x] Vermin (V-scale)
  • [x] Fontainebleau

Aid

  • [x] A# & C#
  • [ ] Aid with mandatory free climbing (5.8 A0, etc)

Ice

  • [x] Winter Ice (WI#)
  • [x] Alpine Ice (AI#)

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

  • Convert Grades to Scores
import { French, YosemiteDecimal } from '@openbeta/sandbag'

const score = French.getScore('8a') // Output [ 84, 85 ]

// Support slash grade
const slashGradeScore=French.getScore('7c+/8a') // Output [ 83, 84 ]

// Accept +/- modifier
const plusGrade= YosemiteDecimal.getScore('5.12+') // Output [ 79, 80 ]
  • Convert Scores to Grades
import { Font } from '@openbeta/sandbag'

// Single score provided
Font.getGrade(80) // Output '7c'

// Support a range of scores 
Font.getGrade([79,81]) // Output'7b+/7c'
  • Validate Grading Scales
import { VScale , Font }from '@openbeta/sandbag'

console.log('Is 6A a V Scale?',VScale.isType('6A'))  // Output false
console.log('Is 6A a Font Scale?',Font.isType('6A')) // Output true
  • Convert Grades Across Scales
import {convertGrade , GradeScales }from '@openbeta/sandbag'

const ydsInFrench=convertGrade('5.11a',GradeScales.YDS,GradeScales.FRENCH) // Output '6b+/6c'

const fontInVScale=convertGrade('6a',GradeScales.FONT,GradeScales.VSCALE) //OutPut 'V3'

// Conversions across different disciplines are not allowed
const sportToBoulder=convertGrade('5.11a',GradeScales.YDS,GradeScales.VSCALE)
// Output: Scale: Yosemite Decimal System doesn't support converting to Scale: V Scale
// ''
  • Get Gradeband
import { Ewbank } from '@openbeta/sandbag'

Ewbank.getGradeBand('10') // Output: 'beginner'
Ewbank.getGradeBand('30') // Output: 'expert'
Ewbank.getGradeBand('6a') // Output: Unexpected grade format: 6a for grade scale Ewbank 'unknown'
  • Compare Grades

import { French, YosemiteDecimal } from '@openbeta/sandbag'

const harder = French.getScore('8a')  // Output: [ 84, 85 ]
const easier = YosemiteDecimal.getScore('5.13a') // Output: [ 82, 83 ]

console.log('Is 8a harder than 5.13a?',harder > easier) // Output: true

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!