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

strictjs-runtime

v2.0.7

Published

A lightweight low-level runtime for StrictJS with WebAssembly support.

Readme

StrictJS Runtime

StrictJS Runtime is an experimental, low-level JavaScript runtime powered by WebAssembly (WASM).

It’s built to give JavaScript strict data handling, Rust-like safety, and C-like performance — while staying fully compatible with any environment where JS runs: browser, Node.js, React Native, TensorFlow.js, and more.


Why StrictJS?

JavaScript is powerful but loose.

  • Memory is garbage-collected and unpredictable.
  • Numbers, arrays, and objects are dynamic but error-prone.
  • Performance bottlenecks appear in games, simulations, trading platforms, and AI applications.

StrictJS Runtime solves these problems by introducing strict, typed structures running inside a WebAssembly core — without abandoning JavaScript.

Think of it as:

  • The discipline of Rust,
  • The familiarity of JavaScript,
  • And the flexibility to run anywhere.

Key Features

  • 🚀 High performance – WebAssembly core for heavy computation.
  • 🧩 Strict memory control – Typed arrays and objects with predictable behavior.
  • 🛡 Runtime type safety – Reduce hidden bugs and crashes.
  • 🌐 Cross-platform – Works in browsers, Node.js, and other JS runtimes.
  • Universal integration – Plug it into Three.js, TensorFlow.js, React Native, or your backend logic.

Installation

Install via npm:

npm install strictjs-runtime

Or use pnpm:

pnpm add strictjs-runtime

Or yarn:

yarn add strictjs-runtime

Or load directly from a CDN in the browser:

<script src="https://unpkg.com/strictjs-runtime/pkg/strictjs_runtime.js"></script>

Quick Start

Here's a minimal example showing how to initialize StrictJS Runtime and work with strict arrays.



// demo.js
import strictInit from "strictjs-runtime";

const run = async () => {
  const { StrictObject, StrictFunction, HeapType } = await strictInit({});

  console.log("=== StrictJS Demo ===\n");

  // ======= Test 1: Basic Object with Schema =======
  const userSchema = {
    id: "u32",
    name: "string",
    age: "u8",
    isActive: "bool",
    balance: "f64"
  };

  const user = new StrictObject(userSchema);
  user.setField("id", 1234567890);
  user.setField("name", "Alice Johnson");
  user.setField("age", 28);
  user.setField("isActive", true);
  user.setField("balance", 999.99);

  console.log("ID:", user.getFieldAsNumber("id"));
  console.log("Name:", user.getFieldAsString("name"));
  console.log("Age:", user.getFieldAsNumber("age"));
  console.log("Active:", user.getFieldAsBoolean("isActive"));
  console.log("Balance:", user.getFieldAsNumber("balance"));

  // ======= Test 2: Nested Objects =======
  const productSchema = {
    id: "u32",
    name: "string",
    metadata: {
      category: "string",
      tags: {
        featured: "bool",
        newArrival: "bool"
      }
    }
  };

  const product = new StrictObject(productSchema);
  product.setField("metadata", {
    category: "Electronics",
    tags: { featured: true, newArrival: false }
  });

  const metadata = product.getNestedObject("metadata");
  const tags = metadata.getNestedObject("tags");

  console.log("\nProduct Category:", metadata.getFieldAsString("category"));
  console.log("Featured:", tags.getFieldAsBoolean("featured"));
  console.log("New Arrival:", tags.getFieldAsBoolean("newArrival"));

  // ======= Test 3: WebAssembly-backed StrictFunction =======
  const addU8 = new StrictFunction(
    new Function("a", "b", "return a + b;"),
    ["u8", "u8"],
    "u8"
  );

  console.log("\nStrictFunction Add Result (u8 overflow demo):", addU8.call([200, 56]));

  const multiplyU16 = new StrictFunction(
    new Function("x", "y", "return x * y;"),
    ["u16", "u16"],
    "u16"
  );

  console.log("StrictFunction Multiply Result:", multiplyU16.call([300, 300]));
};

run().catch(console.error);



Core APIs

HeapType

An enum representing different memory layouts for strict arrays.

| Type | Description | |---------|--------------------------| | U8 | Unsigned 8-bit integer | | I32 | Signed 32-bit integer | | F32 | 32-bit floating-point | | F64 | 64-bit floating-point |


StrictArray

A fixed-size, type-safe array backed by the WASM heap.

const arr = new StrictArray(HeapType.U8, 3);
arr.set(0, 10);
console.log(arr.get(0)); // → 10

StrictFunction

Wraps JavaScript functions with runtime type checking and strict argument enforcement.

const multiply = new StrictFunction(
  (a, b) => a * b,
  ["u8", "u8"], // Input types
  "u8"          // Output type
);

console.log(multiply.call([5, 6])); // → 30

Project Status

StrictJS Runtime is early stage and experimental.

  • ✅ Stable core runtime for strict arrays and functions.
  • ⚠️ APIs are evolving — expect breaking changes before v1.0.
  • 🧪 Best for experiments, demos, and learning how to integrate strict, low-level operations into your JS projects.

Roadmap

  • [ ] Strict object system
  • [ ] Improved type inference and enforcement
  • [ ] Developer tools & debugging support
  • [ ] Performance benchmarks
  • [ ] Integrations with React, TensorFlow.js, and Three.js
  • [ ] Potential compiler to StrictJS language for low-level JS development

Contributing

Contributions are welcome!

  1. Fork the repo
  2. Create a feature branch
  3. Submit a pull request with clear explanations and tests

License

This project is licensed under the MIT License. See the LICENSE file for details.


Links


Vision

StrictJS is starting small — just a runtime today — but it has big potential:

  • It could grow into a framework, powering full apps like React or Vue.
  • It could evolve into a language, compiling to strict, predictable JavaScript.
  • It could remain a universal tool, dropped into any stack to bring low-level safety and performance.

"Wherever JavaScript runs, StrictJS can run too."