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

@jingx/baccarat-threejs

v1.0.7

Published

Three.js Baccarat table animation packaged as a React component for Next.js.

Downloads

390

Readme

baccarat-threejs

Three.js baccarat table animation packaged as:

  • a React component: BaccaratGame
  • a lower-level runtime factory: createBaccaratGame

Install

npm install @jingx/baccarat-threejs

React usage

import { BaccaratGame } from "@jingx/baccarat-threejs";

export default function Page() {
  return (
    <main style={{ width: "100%", height: "100vh" }}>
      <BaccaratGame
        currentCountdown={14}
        playerCards={[
          { suit: "spade", rank: "A", ordering: 1 },
          { suit: "club", rank: "9", ordering: 2 },
        ]}
        bankerCards={[
          { suit: "diamond", rank: "10", ordering: 1 },
          { suit: "heart", rank: "8", ordering: 2 },
        ]}
        result="Player"
        showResultSeconds={5}
      />
    </main>
  );
}

Runtime usage

import { createBaccaratGame } from "@jingx/baccarat-threejs";

const game = createBaccaratGame({
  container: document.getElementById("scene-root"),
  currentCountdown: 14,
  playerCards: [
    { suit: "spade", rank: "A", ordering: 1 },
    { suit: "club", rank: "9", ordering: 2 },
  ],
  bankerCards: [
    { suit: "diamond", rank: "10", ordering: 1 },
    { suit: "heart", rank: "8", ordering: 2 },
  ],
  result: "Player",
  showResultSeconds: 5,
});

game.setCurrentCountdown(13);
game.destroy();

Options

  • container Runtime only. Required mount element.
  • playerCards Ordered player hand data. Up to 3 cards are rendered.
  • bankerCards Ordered banker hand data. Up to 3 cards are rendered.
  • playerCard Optional fallback face card code when playerCards is empty. Default: TWO_SPADES.
  • bankerCard Optional fallback face card code when bankerCards is empty. Default: TEN_DIAMONDS.
  • currentCountdown External countdown value used to drive round state.
  • result Result overlay text, for example "Player", "Banker", or "Tie".
  • showResultSeconds Result display duration in seconds. Default: 2.
  • beforeCountdownSeconds Optional positive number used as the pause before reveal.
  • startNewRoundAt Optional countdown threshold for starting a new round.
  • showResultDurationSeconds Alias for result display duration.
  • onAfterRelease Callback fired after all cards are revealed.

Countdown behavior

  • The default fresh-round trigger is currentCountdown === 14.
  • While currentCountdown > 0, the countdown overlay shows the remaining value.
  • If the first countdown value is already 0 or below, the scene waits for the next fresh round.
  • Update the runtime with game.setCurrentCountdown(nextValue) as your external countdown changes.

Build

npm run build