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

@simmit/sdk

v0.1.1

Published

TypeScript SDK for Simmit, an API for running SimulationCraft (SimC) in the cloud

Downloads

234

Readme

Simmit SDK for TypeScript

CI npm

TypeScript SDK for Simmit, an API for running SimulationCraft in the cloud.

Send the same .simc profile you'd run locally and Simmit executes SimulationCraft (SimC) for you on managed hardware, so you can run sims from anywhere that can make an HTTP request, with no local SimC build to manage.

Documentation: dashboard.simmit.com/docs

Installation

npm install @simmit/sdk

Node 20+. Zero runtime dependencies (global fetch and WebCrypto only).

Usage

import Simmit from '@simmit/sdk'

const client = new Simmit({
  secretKey: process.env['SIMMIT_SECRET_KEY'] // This is the default and can be omitted
})

// Submit a SimC profile, wait for the sim to finish, and read the result.
const job = await client.jobs.createAndWait({
  build: { channel: 'latest' },
  profile: { text: profileText } // a SimC profile, up to 2 MB
})

const result = await client.jobs.getResult(job.id)

The rest of the surface is shown below until an SDK reference lands in the docs.

Progress hooks

createAndWait is ideal for scripts and queue workers that can hold a promise open. Hook into progress, or capture the job id before polling starts:

await client.jobs.createAndWait(
  { build: { channel: 'latest' }, profile: { text: profileText } },
  {
    onCreated: (res) => console.log('queued', res.id),
    onPoll: (status) => console.log(status.status, status.progress.percent)
  }
)

Submit, poll, and read the result (decoupled)

For web apps that can't hold a promise open, drive the lifecycle yourself: create returns immediately with a job id to persist, then poll getStatus on your own cadence and read the result once terminal. A job.terminal webhook is the reliable completion signal when a browser poll can pause (see below).

const { id } = await client.jobs.create({
  build: { channel: 'nightly' },
  profile: { text: profileText }
})
// persist `id`, return to the caller, then from a later request:

const status = await client.jobs.getStatus(id) // status + progress, in any state
if (status.status === 'completed') {
  const result = await client.jobs.getResult(id)
}

await client.jobs.cancel(id) // request cancellation

Artifact download URLs

getResult returns each artifact with a stable download url, valid for the artifact's full retention window. To fetch that URL on demand instead (e.g. a browser flow that controls the final fetch), use:

const { url } = await client.artifacts.getUrl(artifactId)

Credits

const balance = await client.credits.get()

Errors

Every API error is a typed subclass of SimmitError, with a narrowed code and meta:

import { InsufficientCreditsError, InvalidProfileError } from '@simmit/sdk'

try {
  await client.jobs.create({ build: { channel: 'latest' }, profile: { text } })
} catch (err) {
  if (err instanceof InvalidProfileError) {
    console.error(err.meta.blocked) // the rejected profile lines
  } else if (err instanceof InsufficientCreditsError) {
    console.error(err.meta?.maxAffordableRuntimeSeconds)
  } else {
    throw err
  }
}

createAndWait also throws JobFailedError / JobCancelledError / JobTimedOutError (each carrying the full .job), and JobWaitTimeoutError if the wait deadline passes before the job finishes. The job keeps running, so call client.jobs.cancel(jobId) to stop the spend.

Response headers

Single-request methods return an APIPromise. Await it for the parsed body, or use .withResponse() to reach the raw Response (rate-limit headers, idempotent replays):

const { data, response } = await client.jobs.create(params).withResponse()
response.headers.get('x-idempotent-replay')

Verifying webhooks

unwrapWebhook verifies a webhook signature and returns the parsed event. It is standalone (no client and no API key required, just your webhook signing secret), so it is safe to run in a webhook receiver:

import { unwrapWebhook } from '@simmit/sdk'

const event = await unwrapWebhook(
  rawBody, // the raw request body, exactly as received
  signatureHeader, // the X-Simmit-Signature header value
  process.env.SIMMIT_WEBHOOK_SECRET
)

if (event.payload.status === 'completed') {
  // ...
}

Development

  • Node 20+ (.nvmrc pins the dev version), pnpm.
  • pnpm generate regenerates src/generated/openapi.d.ts from the committed openapi.json snapshot. Never hand-edit generated output; only src/api-types.ts may import from src/generated/.
  • pnpm build builds dual ESM+CJS via tsup.
  • pnpm test runs vitest (hermetic; mocks fetch, no network).
  • pnpm smoke runs a manual check against a real API (needs SIMMIT_SECRET_KEY; set SIMMIT_PROFILE_FILE to also run a full create-then-result, or TEST_API_BASE_URL to target a non-prod endpoint). See scripts/smoke.mjs.

License

MIT