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

use-street-fighting-command

v0.1.0

Published

React custom hooks for detecting Street Fighter-style command inputs

Downloads

108

Readme

use-street-fighting-command

use-street-fighting-command

Disclaimer: This is an unofficial fan-made project and is not affiliated with, endorsed by, or connected to Capcom or the Street Fighter franchise in any way. "Street Fighter" is a registered trademark of Capcom Co., Ltd.

React custom hooks for detecting Street Fighter-style command inputs.

Demo

Installation

npm install use-street-fighting-command

Or using other package managers:

pnpm add use-street-fighting-command
yarn add use-street-fighting-command

Commands

Motion Commands

| Command | Input | Notation | |---------|-------|----------| | Hadouken | ↓↘→+P | 236P | | Shoryuken | →↓↘+P | 623P | | Tatsumaki | ↓↙←+K | 214K |

Charge Commands

| Command | Input | Notation | |---------|-------|----------| | Sonic Boom | ←charge→+P | [4]6P | | Spinning Bird Kick | ↓charge↑+K | [2]8K |

Super Commands

| Command | Input | Notation | |---------|-------|----------| | Shinku Hadouken | ↓↘→↓↘→+P | 236236P |

Button Sequence Commands

| Command | Input | Notation | |---------|-------|----------| | Shun Goku Satsu | P P →+K P | LP LP → LK HP |

Usage

useStreetFightingCommand (Recommended)

A unified hook that detects multiple commands. Only commands with provided callbacks are activated.

import { useStreetFightingCommand } from "use-street-fighting-command";

function App() {
  useStreetFightingCommand({
    onHadouken: () => console.log("Hadouken!"),
    onShoryuken: () => console.log("Shoryuken!"),
    onTatsumaki: () => console.log("Tatsumaki!"),
    onSonicBoom: () => console.log("Sonic Boom!"),
    onSpinningBirdKick: () => console.log("Spinning Bird Kick!"),
    onShinkuHadouken: () => console.log("Shinku Hadouken!"),
    onShunGokuSatsu: () => console.log("Shun Goku Satsu!"),
  });

  return <div>Press commands!</div>;
}

Enable only specific commands:

// Only Hadouken is detected
useStreetFightingCommand({
  onHadouken: () => console.log("Hadouken!"),
});

Individual Hooks

You can also use individual hooks for each command:

import {
  useHadoken,
  useShoryuken,
  useTatsumaki,
  useSonicBoom,
  useSpinningBirdKick,
  useShinkuHadouken,
  useShunGokuSatsu,
} from "use-street-fighting-command";

function App() {
  // Motion commands
  useHadoken({ onCommand: () => console.log("Hadouken!") });
  useShoryuken({ onCommand: () => console.log("Shoryuken!") });
  useTatsumaki({ onCommand: () => console.log("Tatsumaki!") });

  // Charge commands
  useSonicBoom({ onCommand: () => console.log("Sonic Boom!") });
  useSpinningBirdKick({ onCommand: () => console.log("Spinning Bird Kick!") });

  // Super commands
  useShinkuHadouken({ onCommand: () => console.log("Shinku Hadouken!") });

  // Button sequence commands
  useShunGokuSatsu({ onCommand: () => console.log("Shun Goku Satsu!") });

  return <div>Press commands!</div>;
}

Controls

Directional Input

  • Arrow keys:
  • WASD: W A S D

Buttons

  • Punch: P
  • Kick: K

Options

useStreetFightingCommand

| Option | Type | Default | Description | |--------|------|---------|-------------| | onHadouken | () => void | - | Callback for Hadouken (↓↘→+P) | | onShoryuken | () => void | - | Callback for Shoryuken (→↓↘+P) | | onTatsumaki | () => void | - | Callback for Tatsumaki (↓↙←+K) | | onSonicBoom | () => void | - | Callback for Sonic Boom (←charge→+P) | | onSpinningBirdKick | () => void | - | Callback for Spinning Bird Kick (↓charge↑+K) | | onShinkuHadouken | () => void | - | Callback for Shinku Hadouken (↓↘→↓↘→+P) | | onShunGokuSatsu | () => void | - | Callback for Shun Goku Satsu (P P →+K P) | | side | "1P" | "2P" | "1P" | Player side (affects forward direction) | | inputWindow | number | 500 | Time window in ms to complete motion command (800ms for Shinku Hadouken, 1000ms for Shun Goku Satsu) | | chargeTime | number | 800 | Time in ms to hold charge direction |

Motion Command Hooks (useHadoken, useShoryuken, useTatsumaki)

| Option | Type | Default | Description | |--------|------|---------|-------------| | onCommand | () => void | required | Callback when command is detected | | side | "1P" | "2P" | "1P" | Player side (affects forward direction) | | inputWindow | number | 500 | Time window in ms to complete command |

Charge Command Hooks (useSonicBoom, useSpinningBirdKick)

| Option | Type | Default | Description | |--------|------|---------|-------------| | onCommand | () => void | required | Callback when command is detected | | side | "1P" | "2P" | "1P" | Player side (affects forward direction) | | chargeTime | number | 800 | Time in ms to hold charge direction | | inputWindow | number | 500 | Time window in ms after charge to input release |

Super Command Hook (useShinkuHadouken)

| Option | Type | Default | Description | |--------|------|---------|-------------| | onCommand | () => void | required | Callback when command is detected | | side | "1P" | "2P" | "1P" | Player side (affects forward direction) | | inputWindow | number | 800 | Time window in ms to complete command |

Button Sequence Hook (useShunGokuSatsu)

| Option | Type | Default | Description | |--------|------|---------|-------------| | onCommand | () => void | required | Callback when command is detected | | side | "1P" | "2P" | "1P" | Player side (affects forward direction) | | inputWindow | number | 1000 | Time window in ms to complete sequence |

Side Configuration

  • 1P: Right is forward (commands entered as shown above)
  • 2P: Left is forward (commands are mirrored)
// 2P side - command becomes ↓↙←+P
useHadoken({
  side: "2P",
  onCommand: () => console.log("Hadouken!"),
});

Custom Input Window

// Stricter timing (300ms)
useHadoken({
  onCommand: handleHadouken,
  inputWindow: 300,
});

License

MIT