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

@autochitect/engine

v1.1.7

Published

A 245KB WebAssembly financial modeling engine. Define cost models in a purpose-built DSL, get instant estimates with full dependency tracing. No server required.

Downloads

1,223

Readme

@autochitect/engine

A 245KB WebAssembly cost estimation engine. Define cost models in a purpose-built DSL, get instant estimates with full dependency tracing. Runs entirely client-side — no server, no latency, no data leaving the browser.

Install

npm install @autochitect/engine

Node.js

import { createEngine } from '@autochitect/engine';

const engine = await createEngine();

const result = engine.estimate(`
  seats: Input
  base_price_per_seat = 12
  storage_gb: Input
  storage_price_per_gb = 0.50

  seat_cost = seats * base_price_per_seat
  storage_cost = storage_gb * storage_price_per_gb
  subtotal = seat_cost + storage_cost

  discount_rate = IF(seats > 50, 0.20, IF(seats > 20, 0.10, 0))
  discount = subtotal * discount_rate
  monthly_total = subtotal - discount
  annual_total = monthly_total * 12
`, {
  seats: 35,
  storage_gb: 200,
});

console.log(result.results);
// {
//   seats: 35, base_price_per_seat: 12, storage_gb: 200, storage_price_per_gb: 0.5,
//   seat_cost: 420, storage_cost: 100, subtotal: 520,
//   discount_rate: 0.1, discount: 52, monthly_total: 468, annual_total: 5616
// }

Browser

No install needed — paste this into an HTML file and open it.

<script type="module">
  import { createEngine } from 'https://esm.sh/@autochitect/engine';

  const engine = await createEngine(
    'https://unpkg.com/@autochitect/engine/engine.wasm'
  );

  const result = engine.estimate(`
    seats: Input
    base_price_per_seat = 12
    storage_gb: Input
    storage_price_per_gb = 0.50

    seat_cost = seats * base_price_per_seat
    storage_cost = storage_gb * storage_price_per_gb
    subtotal = seat_cost + storage_cost

    discount_rate = IF(seats > 50, 0.20, IF(seats > 20, 0.10, 0))
    discount = subtotal * discount_rate
    monthly_total = subtotal - discount
    annual_total = monthly_total * 12
  `, {
    seats: 35,
    storage_gb: 200,
  });

  console.log(result.results);
  // {
  //   seats: 35, base_price_per_seat: 12, storage_gb: 200, storage_price_per_gb: 0.5,
  //   seat_cost: 420, storage_cost: 100, subtotal: 520,
  //   discount_rate: 0.1, discount: 52, monthly_total: 468, annual_total: 5616
  // }
</script>

If you use a bundler (Vite, webpack, etc.), import normally:

import { createEngine } from '@autochitect/engine';

const engine = await createEngine(
  new URL('@autochitect/engine/engine.wasm', import.meta.url)
);

What you get

result.results — computed values for every variable.

result.graph — the full dependency DAG showing how each value was derived. Nodes have kind (input, formula, map, scan) and edges show data flow. Build audit trails, trace calculations back to source inputs, or render interactive cost breakdowns.

result.errors / result.warnings — with line and column numbers.

The DSL

# Inputs — bind to external data (your JSON)
revenue: Input("annual_revenue")
headcount: Input

# Constants — use formula assignment
tax_rate = 0.21
avg_salary = 85000

# Params — tunable scenario knobs (passed via inputs)
growth: Param

# Formulas — define cost relationships
labor_cost = headcount * avg_salary
gross_profit = revenue * (1 - tax_rate)
net_income = gross_profit * (1 - tax_rate)

# Array operations — project over time
periods = SEQUENCE(12, 1, 1)
monthly = MAP(periods, LAMBDA(p, revenue / 12 * POWER(1 + growth, p)))

# Accumulation — running totals
cumulative = SCAN(monthly, 0, LAMBDA(acc, m, acc + m))

Inputs bind to external data (your JSON). Constants are defined with formula assignment (name = value). Params are tunable scenario knobs passed via the inputs object.

MAP transforms arrays element-wise. SCAN accumulates (like reduce, but returns intermediate results). LAMBDA defines inline functions with named parameters.

Options

// Skip the dependency graph for faster estimation
engine.estimate(source, inputs, { graph: false });

TypeScript

Full type definitions are included. Key types:

import type { Engine, EstimateResult, EstimateOptions } from '@autochitect/engine';

License

MIT