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

f1-nexus-wasm

v1.0.0-alpha.2

Published

Formula 1 race strategy optimization in the browser using WebAssembly - Real-time pit stop calculations, tire management, and race simulation

Readme

f1-nexus-wasm

npm Crates.io License

F1 Nexus WebAssembly bindings for browser-based Formula 1 race strategy optimization.

Features

  • 🌐 Browser-Native: Run F1 strategy optimization directly in the browser
  • ⚡ High Performance: Near-native speed using WebAssembly
  • 📦 Zero Server Cost: All computation happens client-side
  • 🔒 Data Privacy: No data leaves the user's browser
  • 📱 Cross-Platform: Works on desktop, mobile, and tablets
  • 🎯 TypeScript Support: Full type definitions included

Installation

npm

npm install @f1-nexus/wasm

yarn

yarn add @f1-nexus/wasm

pnpm

pnpm add @f1-nexus/wasm

Quick Start

import init, { F1Nexus } from '@f1-nexus/wasm';

// Initialize WASM module
await init();

// Create F1 Nexus instance
const f1 = new F1Nexus();

// Optimize pit strategy
const strategy = f1.optimizeStrategy({
  track: 'monaco',
  totalLaps: 78,
  currentLap: 1,
  currentCompound: 'C3',
  availableCompounds: ['C1', 'C2', 'C3'],
  fuelRemaining: 110.0,
  position: 3
});

console.log('Optimal Strategy:');
console.log(`Starting compound: ${strategy.startingCompound}`);
strategy.pitStops.forEach((stop, i) => {
  console.log(`Stop ${i + 1}: Lap ${stop.lap} → ${stop.compound}`);
});
console.log(`Predicted race time: ${strategy.predictedRaceTime}s`);

React Integration

import { useEffect, useState } from 'react';
import init, { F1Nexus } from '@f1-nexus/wasm';

function StrategyOptimizer() {
  const [f1, setF1] = useState<F1Nexus | null>(null);
  const [strategy, setStrategy] = useState(null);

  useEffect(() => {
    init().then(() => {
      setF1(new F1Nexus());
    });
  }, []);

  const optimize = () => {
    if (!f1) return;
    const result = f1.optimizeStrategy({
      track: 'monaco',
      totalLaps: 78,
      availableCompounds: ['C1', 'C2', 'C3']
    });
    setStrategy(result);
  };

  return (
    <div>
      <button onClick={optimize}>Optimize Strategy</button>
      {strategy && <StrategyDisplay strategy={strategy} />}
    </div>
  );
}

API Reference

optimizeStrategy(params)

Find optimal pit stop strategy using dynamic programming.

Parameters:

  • track: string - Circuit name (e.g., 'monaco', 'silverstone')
  • totalLaps: number - Total race laps
  • availableCompounds: string[] - Tire compounds available
  • currentLap?: number - Current lap (default: 1)
  • fuelRemaining?: number - Fuel in kg (default: 110.0)

Returns: { strategyId, startingCompound, pitStops[], predictedRaceTime, confidence }

simulateRace(params)

Run Monte Carlo simulation to validate strategy.

Parameters: Strategy + simulation config Returns: Distribution of finish times, confidence intervals

predictTireLife(params)

Predict tire degradation and optimal pit window.

Parameters: Tire data + track conditions Returns: Remaining laps, degradation rate

getCircuits()

Get list of supported F1 circuits.

Returns: string[] - Circuit IDs

getTireCompounds()

Get list of tire compound types.

Returns: string[] - Compound IDs (C0-C5, Intermediate, Wet)

version()

Get package version.

Returns: string - Version number

Supported Browsers

  • ✅ Chrome 90+
  • ✅ Firefox 89+
  • ✅ Safari 15+
  • ✅ Edge 90+

Bundle Size

  • WASM: ~280 KB (uncompressed)
  • JS Glue: ~15 KB
  • Gzipped Total: ~95 KB

Performance

  • Optimization: <50ms for typical race (70 laps, 3 compounds)
  • Simulation: 1,000 iterations in ~200ms
  • Memory: <10MB peak usage

Use Cases

  • F1 Fantasy Apps: Real-time strategy recommendations
  • Educational Tools: Interactive F1 strategy learning
  • Esports: Browser-based F1 game strategy tools
  • Data Visualization: Live strategy analysis dashboards
  • Mobile Apps: PWAs with offline strategy optimization

Examples

See docs/EXAMPLES.md for:

  • Vanilla JavaScript
  • React hooks
  • Vue composition API
  • Real-time updates
  • Web workers

Documentation

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.