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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tumbling-calculator

v1.1.3

Published

A JavaScript library for tumbling calculations

Readme

Tumbling Calculator

A JavaScript library for calculating FIG (Fédération Internationale de Gymnastique) points for tumbling elements.

⚠️ License - Non-Commercial Use Only

This library is distributed under the CC-BY-NC-4.0 (Creative Commons Attribution-NonCommercial 4.0 International) license.

You CAN:

  • ✅ Use this library for personal projects
  • ✅ Use this library for education
  • ✅ Modify and adapt the code
  • ✅ Share the library

You CANNOT:

  • ❌ Use this library in commercial projects
  • ❌ Sell products or services using this library
  • ❌ Use this library in any revenue-generating context

For commercial use, please contact the author to obtain an appropriate license.

Installation

npm install tumbling-calculator

Usage

ES6 Modules

import {calculateFigElement} from 'tumbling-calculator';
import {BASICS_ELEMENTS} from "./models";

// List of Basic Elements
console.log(BASICS_ELEMENTS);
/* [
  { symbol: '!', points: 0 },
  { symbol: 'X', points: 0.1 },
  { symbol: '(', points: 0.1 },
  { symbol: 'f', points: 0.1 },
  { symbol: 'S', points: 0.1 },
  { symbol: '^', points: 0.2 }
] */    

// Calculate FIG points for an element
const points = calculateFigElement('-o');
console.log(points); // 0.5

// More examples
calculateFigElement('-o');     // 0.5 - Back salto
calculateFigElement('-2o');    // 2.4 - Back in Full out
calculateFigElement('42/');    // 4.8 - Double full in full out straight
calculateFigElement('.-/');    // 0.7 - Front straight salto
calculateFigElement('.1');     // 0.8 - Barani
calculateFigElement('.--<');   // 2.3 - Double front pike
calculateFigElement('2--o');   // 6.3 - full in back back

CommonJS

const { calculateFigElement } = require('tumbling-calculator');

const points = calculateFigElement('-o');
console.log(points); // 0.5

Symbol Notation

The library uses a symbolic notation to represent tumbling elements:

Basic Symbols

  • . - Front-facing element indicator (placed at the beginning)
  • - - Rotation (each - represents one rotation)
  • 0-9 - Half-twists (numbers indicate the number of half-twists)
  • o - Position indicator (tuck)
  • < - Position indicator (pike)
  • / - Position indicator (straight)

Basic Elements

The following basic elements are recognized with fixed values:

  • ! - 0.0 points
  • X - 0.1 points
  • ( - 0.1 points
  • f - 0.1 points
  • S - 0.1 points
  • ^ - 0.2 points

Complex Elements

For complex elements, the library calculates points based on:

  1. Rotation points: 0.5 points per rotation
  2. Front bonus: 0.1 points per rotation for front-facing elements (starting with .)
  3. Twist points: Progressive scoring based on number of rotations and half-twists
  4. Position bonus: Additional points based on the final position indicator (< or /)

All calculated points are multiplied by the number of rotations to get the final score.

API

calculateFigElement(symbol)

Calculates the FIG points of a tumbling element based on its symbol.

Parameters:

  • symbol (string): Symbol representing the tumbling element

Returns:

  • (number): FIG points of the element, rounded to 1 decimal place

Examples:

// Basic elements
calculateFigElement('(');   // 0.1

// Back salto with position
calculateFigElement('-o');  // 0.5

// Double back with twist
calculateFigElement('-2o'); // 2.4

// Quad with complex twist
calculateFigElement('42/'); // 4.8

// Front salto
calculateFigElement('.-/'); // 0.7

// Front with twist
calculateFigElement('.1');  // 0.8

// Double front with position
calculateFigElement('.--<'); // 2.3

// Triple with twist
calculateFigElement('2--o'); // 6.3

calculateFigRoutine(routine)

Calculates the total FIG points for a routine consisting of multiple tumbling elements.

Parameters:

  • routine (string): Symbol representing the tumbling routine (elements separated by spaces)

Returns:

  • (number): FIG points of the routine, rounded to 1 decimal place

Examples:

calculateRoutine('( ^ ^ f --o')   // 2.6

Development

Install Dependencies

npm install

Build the Library

npm run build

The build process uses Rollup to generate:

  • dist/index.js - CommonJS format
  • dist/index.esm.js - ES Module format

Run Tests

npm test

Tests are written with Jest and located in the tests/ directory.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

When contributing, please:

  1. Write tests for new features
  2. Ensure all tests pass (npm test)
  3. Follow the existing code style
  4. Update documentation as needed

License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC-BY-NC-4.0).

See the LICENSE file for details.

For commercial licensing inquiries, please contact the author.

Author

@maaxow - M-R-Engineering

Links

Acknowledgments

This library implements FIG (Fédération Internationale de Gymnastique) scoring rules for tumbling elements.