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

vektra

v0.2.1

Published

Seed-Driven Deterministic Generative Graphics Library

Downloads

32

Readme

License: MIT Build Status Rust WebAssembly TypeScript


📖 About VEKTRA

VEKTRA is a high-performance, deterministic generative graphics library designed for creating complex, aesthetic, and fully reproducible visual art. Built from the ground up using Rust and WebAssembly, it guarantees that a specific numerical seed will produce the exact same visual output across any device or platform.

Whether you're generating SVG vector art for print, or decoding a binary draw-call stream for Canvas/WebGL rendering in the browser, VEKTRA provides a pristine, zero-dependency core architecture that is fast, safe, and highly extensible.


✨ Features

  • 🔒 Absolute Determinism: Given the same seed, the exact same graphical output is guaranteed. No floating-point discrepancies.
  • 🚀 High-Performance Core: Written in Rust for maximum execution speed and minimal memory footprint.
  • 🕸️ WebAssembly Bridge: Seamlessly integrates into browser and Node/Bun environments via WASM.
  • 📦 TypeScript Native: Strongly-typed API out of the box, with built-in binary decoders for frontend rendering.
  • 🎨 Built-in Aesthetic Presets: Includes curated generative algorithms (Void, Nebula, Monolith, Bloom).
  • 📐 Rich Primitive System: Generates complex patterns using mathematical primitives (Voronoi, Wave, Stipple, Subdivide, Flow, Scatter).
  • 💾 Dual Output Formats:
    • SVG: For crisp, scalable vector graphics.
    • Binary DIS (Draw Instruction Stream): A highly optimized, compact binary format that can be easily parsed for high-FPS Canvas/WebGL rendering.

🏗️ Architecture & Structure

VEKTRA is structured as a monorepo containing the Rust core, WASM bridge, and TypeScript package.

vektra/
├── crates/
│   ├── vektra-core/     # The pure Rust generative engine (Zero Dependencies)
│   └── vektra-wasm/     # The WebAssembly bridge and memory management
└── packages/
    └── vektra/          # The TypeScript/JavaScript wrapper package

1. vektra-core

The brain of VEKTRA. It handles random number generation, spatial mathematics, the rendering pipeline, and the generation of the Draw Instruction Stream (DIS).

2. vektra-wasm

Provides the VektraSession FFI bridge. It takes the Rust core's logic and exposes it via wasm-bindgen so it can be called directly from JavaScript.

3. packages/vektra

The frontend library. It initializes the WASM module and provides a clean TypeScript class for generating graphics, alongside a robust DisDecoder for parsing the binary stream.


🚀 How to Use

Installation

You can install VEKTRA via NPM or Bun:

# Using NPM
npm install vektra

# Using Bun
bun add vektra

# Using Yarn
yarn add vektra

(Note: To build VEKTRA from source or contribute to the Rust core, please see BUILD.md).

Quick Start Example (TypeScript)

Here is how to generate a deterministic SVG using VEKTRA in a Node or Bun environment:

import { VektraSession, initVektraSync } from 'vektra';
import * as fs from 'fs';
import * as path from 'path';

// 1. Initialize the WASM Module
const wasmPath = path.join(process.cwd(), 'wasm', 'vektra_wasm_bg.wasm');
const wasmBuffer = fs.readFileSync(wasmPath);
initVektraSync(wasmBuffer); // For browser, use await initVektra('/path/to/wasm')

// 2. Create a Session (Seed: 12345, Width: 800, Height: 600)
const session = new VektraSession(12345, 800, 600);

// 3. Set a Generative Preset
session.setPreset("Nebula");

// 4. Generate SVG Output
const svgString = session.generateSvg();
fs.writeFileSync("output.svg", svgString);

// 5. Generate Binary Stream (For Canvas/WebGL rendering)
const binaryData = session.generateBinary();

// 6. Decode Binary Stream
import { DisDecoder } from 'vektra';
const decoder = new DisDecoder(binaryData);
const drawInstructions = decoder.decode();

console.log(drawInstructions.slice(0, 5));

🎨 Primitives & Presets

Available Primitives

VEKTRA's core utilizes a series of generative mathematical primitives:

  • Voronoi: Cellular spatial partitioning.
  • Wave: Sine/Cosine harmonic interference patterns.
  • Stipple: Density-driven point placement.
  • Subdivide: Recursive geometric splitting.
  • Flow: Perlin/Simplex noise vector fields.
  • Scatter: Controlled random distribution.

Curated Presets

  • Void: Minimalist, dark, and geometric.
  • Nebula: Organic, flowing, and colorful.
  • Monolith: Brutalist, structural, and sharp.
  • Bloom: Soft, radiating, and complex.

👨‍💻 Developer & Credits