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

@hizi.io/engine-generator

v0.5.0

Published

TypeScript helper library for outputting slot engine bet results to hizi engine format

Readme

@hizi.io/engine-generator

TypeScript library for slot engine developers to write bet results as brotli-compressed JSONL files in the format the hizi engine runtime consumes. Runs in Node.js (writes to disk) and in the browser (writes to OPFS).

Install

npm install @hizi.io/engine-generator

Available on npm: https://www.npmjs.com/package/@hizi.io/engine-generator

Quick start

import { HiziEngineGenerator } from '@hizi.io/engine-generator';

const generator = new HiziEngineGenerator();
await generator.start('./output/');

for (let i = 0; i < 1_000_000; i++) {
  const spin = simulateSpin();
  generator.addResult(
    { reels: spin.reelPositions, symbols: spin.visibleSymbols },
    { win: spin.winAmount, metaTags: spin.winAmount === 0 ? ['no-win'] : [] },
  );
}

await generator.end({ config: { gameCode: 'my-slot' } });
// Output: entries.jsonl.br, scenarios.jsonl.br, config.json

Highlights

  • Streaming output — entries and scenarios are written as you go, then brotli-compressed on end()
  • Automatic entry merging — results with the same win, metaTags, and featureAwards collapse into one entry with accumulating weight
  • Scenario limiting — configurable cap per entry (maxScenariosPerEntry, default 1000)
  • Buy-feature support — resolve from entry metaTags via entrypool and stakeboost strategies
  • Node and browser — auto-detects between fs and OPFS

Common patterns

Multi-step scenarios

generator.addResult(
  [
    { reels: spin1, sticky: [] },
    { reels: spin2, sticky: [[0, 1]] },
  ],
  { win: totalWin },
);

Multiple features

All features write to the same output directory, distinguished by the feature option:

generator.addResult(baseScenario, { win, metaTags, featureAwards });
generator.addResult(freespinScenario, { feature: 'freespin', win, metaTags });

Free-spin trigger

generator.addResult(scenario, {
  win: 0,
  metaTags: ['freespin-trigger'],
  featureAwards: {
    type: 'randomChoice',
    awards: [{ count: 10, feature: 'freespin' }],
  },
});

API surface

| Method | Purpose | | ---------------------------------------------------------------------- | -------------------------------------------------------- | | new HiziEngineGenerator({ maxScenariosPerEntry? }) | Create a generator | | start(outputDirectory) | Open the output directory and begin streaming | | addResult(scenario, options) | Record a result; merges with matching entries | | buildBuyFeatures(definitions) | Resolve buy-feature definitions from current entries | | end({ config?, buyFeatures?, buyFeatureDefinitions? }) | Finalize: write entries, compress to .br, write config | | dbEntryCount | Unique entry count (read before end()) | | featureTotalWeights | Feature → totalWeight map (after end()) | | HiziEngineGenerator.loadEntries(entriesJsonl, scenariosJsonl, feat?) | Static: load all entries with scenarios | | HiziEngineGenerator.loadEntryMetadata(entriesJsonl, feat?) | Static: load entry metadata without scenarios |

Build

npm install
npm run build   # tsc → lib/

Development

npm run dev         # tsc --watch
npm run lint
npm run lint:fix

License

ISC