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

@tpmjs/unsandbox

v0.0.2

Published

AI SDK tools for secure code execution in 42+ programming languages via unsandbox.com

Readme

@tpmjs/unsandbox

AI SDK tools for secure code execution in 42+ programming languages via unsandbox.com.

Installation

npm install @tpmjs/unsandbox
# or
pnpm add @tpmjs/unsandbox

Setup

Get an API key at unsandbox.com/api-keys and set it as an environment variable:

export UNSANDBOX_API_KEY=your-api-key

Usage

import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { executeCode, listLanguages } from '@tpmjs/unsandbox';

const result = streamText({
  model: anthropic('claude-sonnet-4-20250514'),
  tools: {
    executeCode,
    listLanguages,
  },
  system: 'You can execute code in 42+ programming languages using a secure sandbox.',
  prompt: 'Write and run a Python script that calculates the first 10 Fibonacci numbers',
});

Tools

executeCode

Execute code synchronously in a secure sandbox.

import { executeCode } from '@tpmjs/unsandbox';

const result = await executeCode.execute({
  language: 'python',
  code: 'print("Hello, World!")',
});
// { stdout: "Hello, World!\n", stderr: "", exit_code: 0 }

Parameters:

| Name | Type | Required | Description | |------|------|----------|-------------| | language | string | Yes | Programming language (python, javascript, go, rust, etc.) | | code | string | Yes | Source code to execute | | input_files | array | No | Files to make available in /tmp/input/ | | network_mode | string | No | 'zerotrust' (default) or 'semitrusted' | | ttl | number | No | Timeout in seconds (1-900, default 60) | | return_artifact | boolean | No | Return compiled binary for compiled languages | | return_wasm_artifact | boolean | No | Compile to WebAssembly (C, C++, Rust, Zig, Go) |

executeCodeAsync

Execute code asynchronously, returning a job_id for tracking.

import { executeCodeAsync, getJob } from '@tpmjs/unsandbox';

const job = await executeCodeAsync.execute({
  language: 'rust',
  code: 'fn main() { println!("Hello from Rust!"); }',
});

// Check status later
const result = await getJob.execute({ job_id: job.job_id });

runCode

Execute code with automatic language detection from shebang.

import { runCode } from '@tpmjs/unsandbox';

const result = await runCode.execute({
  code: `#!/usr/bin/env python3
print("Auto-detected Python!")`,
});

runCodeAsync

Async version of runCode.

listJobs

List all active jobs for your API key.

import { listJobs } from '@tpmjs/unsandbox';

const jobs = await listJobs.execute({});

getJob

Get status and results of a specific async job.

import { getJob } from '@tpmjs/unsandbox';

const result = await getJob.execute({ job_id: 'abc123' });
// { status: 'completed', stdout: '...', stderr: '...' }

cancelJob

Cancel a running or pending async job.

import { cancelJob } from '@tpmjs/unsandbox';

await cancelJob.execute({ job_id: 'abc123' });

listLanguages

List all 42+ supported programming languages.

import { listLanguages } from '@tpmjs/unsandbox';

const languages = await listLanguages.execute({});

Supported Languages

42+ languages including:

  • Interpreted: Python, JavaScript, TypeScript, Ruby, Perl, PHP, Lua, Bash, R, Elixir, Erlang, Tcl, Scheme, PowerShell, Clojure, Common Lisp, Crystal, Groovy, Deno, AWK, Raku
  • Compiled: C, C++, Go, Rust, Java, Kotlin, COBOL, Fortran, D, Zig, Nim, V, Objective-C, Dart
  • Functional: Julia, Haskell, OCaml, F#, C#, Prolog, Forth

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | UNSANDBOX_API_KEY | Yes | API key from unsandbox.com |

Related

License

MIT