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

@anek-codes/vm

v0.1.2

Published

Common sandbox provider SDK for Anek VM

Readme

Anek VM TypeScript SDK

@anek-codes/vm provides a common sandbox provider interface for Daytona, Anek, Vercel, and E2B. It exposes shared types, command helpers, and provider implementations.

Install

npm install @anek-codes/vm

Provider SDKs are optional peer dependencies. Install the providers you need:

npm install @daytonaio/sdk
npm install @vercel/sandbox
npm install @e2b/sdk

Quick start

import { DaytonaSandboxProvider, SandboxLogger } from '@anek-codes/vm'

const provider = new DaytonaSandboxProvider()
const logger: SandboxLogger = {
  info: async () => {},
  error: async () => {},
}

const result = await provider.createSandbox(
  {
    taskId: 'task-123',
    repoUrl: 'https://github.com/acme/repo',
    apiKeys: {
      OPENAI_API_KEY: process.env.OPENAI_API_KEY,
    },
  },
  logger,
)

if (result.success && result.instance) {
  await result.instance.runCommand('npm', ['install'])
  const url = await result.instance.getDomain(3000)
  await result.instance.stop()
}

Streaming and PTY

Use stdout and stderr to stream output when supported. Set pty to force PTY execution.

await result.instance.runCommand('npm', ['run', 'build'], {
  stdout: process.stdout,
  stderr: process.stderr,
  pty: true,
})

Provider registry

import { getSandboxProvider } from '@anek-codes/vm'

const provider = getSandboxProvider('vercel')
const result = await provider.createSandbox(config, logger)

Environment variables

  • Daytona: DAYTONA_API_KEY, optional DAYTONA_API_URL, DAYTONA_TARGET, DAYTONA_SNAPSHOT
  • Anek: ANEK_API_KEY, optional ANEK_API_URL, ANEK_TARGET, ANEK_SNAPSHOT
  • Vercel: SANDBOX_VERCEL_TEAM_ID, SANDBOX_VERCEL_PROJECT_ID, SANDBOX_VERCEL_TOKEN
  • E2B: E2B_API_KEY or E2B_ACCESS_TOKEN

Provider config overrides

You can pass provider specific settings through providerConfig.

await provider.createSandbox(
  {
    taskId: 'task-123',
    repoUrl: 'https://github.com/acme/repo',
    providerConfig: {
      snapshot: 'my-snapshot',
      autoStopInterval: 30,
    },
  },
  logger,
)

Build

cd vm-sdk/typescript
npm install
npm run build

Testing

The SDK includes comprehensive tests using Node.js's built-in test runner:

# Run all tests
npm test

# Run unit tests only
npm run test:node

# Type check
npm run type-check

Tests cover:

  • Provider interfaces and type definitions
  • Command utilities and project directory mapping
  • Provider registry and factory functions
  • Streaming and PTY support
  • Lifecycle management (start, stop, archive, delete)
  • Error handling

API Reference

Providers

| Provider | Class | Required Env Vars | |----------|-------|-------------------| | Daytona | DaytonaSandboxProvider | DAYTONA_API_KEY | | Anek | AnekSandboxProvider | ANEK_API_KEY | | Vercel | VercelSandboxProvider | SANDBOX_VERCEL_TEAM_ID, SANDBOX_VERCEL_PROJECT_ID, SANDBOX_VERCEL_TOKEN | | E2B | E2BSandboxProvider | E2B_API_KEY or E2B_ACCESS_TOKEN |

ISandboxInstance Methods

| Method | Description | |--------|-------------| | runCommand(cmd, args, options?) | Execute a command in the sandbox | | getDomain(port) | Get public URL for a port | | start() | Start a stopped sandbox | | stop() | Stop the sandbox | | delete() | Permanently delete the sandbox | | archive() | Archive sandbox to storage (Daytona/Anek only) | | isHealthy() | Check if sandbox is responsive | | getMetadata() | Get sandbox metadata | | getProviderInstance() | Get underlying SDK object |

CommandOptions

interface CommandOptions {
  cwd?: string              // Working directory
  detached?: boolean        // Run in background
  env?: Record<string, string>
  stdout?: NodeJS.WritableStream
  stderr?: NodeJS.WritableStream
  timeout?: number          // Timeout in seconds
  stream?: boolean          // Enable streaming
  pty?: boolean | PtyOptions // Use PTY
}

interface PtyOptions {
  cols?: number    // Terminal columns (default: 200)
  rows?: number    // Terminal rows (default: 50)
  timeoutMs?: number
}

Helper Functions

// Get project directory for a provider
getProjectDir('daytona')  // '/home/developer'
getProjectDir('e2b')      // '/home/user'
getProjectDir('vercel')   // '~'

// Run command in project directory
await runInProject(sandbox, 'npm', ['install'])

// Get provider by type
const provider = getSandboxProvider('daytona')

// Get available provider types
const types = getAvailableProviderTypes()

// Register custom provider
registerSandboxProvider(myCustomProvider)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes and add tests
  4. Run npm test to verify
  5. Submit a pull request

License

MIT