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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ski-din-calculator

v1.0.0

Published

Calculate a skier's DIN binding release value based on height, weight, age, skill level, and boot sole length

Readme

Ski DIN Calculator

A comprehensive TypeScript library for calculating ski binding DIN (Deutsches Institut für Normung) release values based on skier characteristics and skiing style.

Installation

npm install ski-din-calculator

Features

  • Two calculation methods: Function-based (metric) and class-based (imperial)
  • Full TypeScript support with detailed type definitions
  • Input validation with descriptive error messages
  • Unit conversion utilities for height and weight
  • Comprehensive test coverage
  • ISO 11088 compliant DIN calculation standards

Quick Start

Function-based Calculator (Metric Units)

import { calculateDIN, convertLbsToKg, convertInchesToCm } from 'ski-din-calculator';

// Calculate DIN for a skier
const result = calculateDIN(
  178,        // height in cm
  75,         // weight in kg  
  28,         // age
  2,          // skill level (1=Cautious, 2=Moderate, 3=Aggressive)
  305         // boot sole length in mm
);

console.log(`DIN Value: ${result?.dinValue}`);
console.log(`Skier Code: ${result?.skierCode}`);

// With unit conversion
const heightCm = convertInchesToCm(70);    // 177.8 cm
const weightKg = convertLbsToKg(160);      // 72.57 kg

const result2 = calculateDIN(heightCm, weightKg, 32, 3, 310);

Class-based Calculator (Imperial Units)

import { DinCalculator, SkierProfile } from 'ski-din-calculator';

const calculator = new DinCalculator();

const profile: SkierProfile = {
  height: 70,       // inches
  weight: 160,      // pounds
  age: 28,
  skill: 2,         // 1=Cautious, 2=Moderate, 3=Aggressive
  soleLength: 305   // millimeters
};

const dinValue = calculator.calculateDIN(profile);
console.log(`DIN Value: ${dinValue}`);

API Reference

Functions

calculateDIN(height, weight, age, skill, bootSoleLength)

Calculates DIN value using metric units.

Parameters:

  • height (number): Height in centimeters (1-250)
  • weight (number): Weight in kilograms (1-150)
  • age (number): Age in years (3-100)
  • skill (number): Skill level - 1 (Cautious), 2 (Moderate), 3 (Aggressive)
  • bootSoleLength (number): Boot sole length in millimeters (200-360)

Returns: DINResult | null

Throws:

  • InvalidHeightError: Height outside valid range
  • InvalidWeightError: Weight outside valid range
  • InvalidAgeError: Age outside valid range
  • InvalidSkierTypeError: Invalid skill level
  • InvalidBootSoleLengthError: Boot sole length outside valid range

lookupDIN(skierCode, bootSoleLength)

Direct DIN lookup by skier code.

Parameters:

  • skierCode (number): Numeric skier code (1-16)
  • bootSoleLength (number): Boot sole length in millimeters

Returns: DINResult | null

Utility Functions

import { 
  convertLbsToKg, 
  convertKgToLbs, 
  convertInchesToCm, 
  convertCmToInches 
} from 'ski-din-calculator';

// Weight conversions
convertLbsToKg(160);    // 72.57 kg
convertKgToLbs(75);     // 165.35 lbs

// Height conversions  
convertInchesToCm(70);  // 177.8 cm
convertCmToInches(180); // 70.87 inches

Class-based Calculator

import { DinCalculator, SkierProfile } from 'ski-din-calculator';

const calculator = new DinCalculator();
const dinValue = calculator.calculateDIN(profile);

Types

DINResult

interface DINResult {
  skierCode: string;              // Letter code (A-P)
  dinValue: number;               // Recommended DIN setting
  twistRange: [number, number];   // Acceptable twist release range
  forwardLeanRange: [number, number]; // Forward lean release range
  torqueRange: [number, number];  // Torque release range
  originalSkierCode: number;      // Numeric skier code used
  safetyWarning: string;          // Safety warnings if applicable
  suggestedRecheckInterval: string; // When to recheck DIN
}

SkierProfile

interface SkierProfile {
  height: number;      // Height in inches
  weight: number;      // Weight in pounds  
  age: number;         // Age in years
  skill: number;       // Skill level (1-3)
  soleLength: number;  // Boot sole length in mm
}

Skill Levels

  • 1 - Cautious: Beginner to intermediate skiers who prefer controlled, comfortable skiing
  • 2 - Moderate: Intermediate skiers who ski at moderate speeds with good control
  • 3 - Aggressive: Advanced/expert skiers who ski fast and aggressively

Error Handling

The library uses specific error types for better error handling:

import { calculateDIN, InvalidHeightError, InvalidWeightError } from 'ski-din-calculator';

try {
  const result = calculateDIN(500, 75, 28, 2, 305); // Invalid height
} catch (error) {
  if (error instanceof InvalidHeightError) {
    console.log(`Height error: ${error.message}`);
    console.log(`Invalid value: ${error.value}`);
  }
}

Safety Warning

⚠️ Important: This calculator is for reference only. Always consult a qualified ski technician for final DIN settings. Incorrect DIN settings can lead to serious injury.

Contributing

Contributions are welcome! Please read our contributing guidelines and ensure all tests pass:

npm test
npm run build

License

MIT © Kris Steigerwald


This library implements the ISO 11088 standard for ski binding release calculations.