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

@freestyle-sh/with-deno

v0.0.6

Published

Deno runtime for [Freestyle](https://freestyle.sh) VMs.

Readme

@freestyle-sh/with-deno

Deno runtime for Freestyle VMs.

Installation

npm install @freestyle-sh/with-deno freestyle

Usage

import { freestyle, VmSpec } from "freestyle";
import { VmDeno } from "@freestyle-sh/with-deno";

const deno = new VmDeno();
const spec = new VmSpec().with("deno", deno);

const { vm } = await freestyle.vms.create({ spec });

const res = await vm.deno.runCode({
  code: "console.log(JSON.stringify({ hello: 'world', runtime: 'deno' }));",
});

console.log(res);
// { result: { hello: 'world', runtime: 'deno' }, stdout: '{"hello":"world","runtime":"deno"}\n', statusCode: 0 }

Options

new VmDeno({
  version: "2.0.0",  // Optional: specific Deno version (default: latest)
})

| Option | Type | Default | Description | |--------|------|---------|-------------| | version | string | undefined | Deno version to install. If not specified, installs the latest version. |

API

vm.deno.runCode({ code: string })

Executes JavaScript/TypeScript code using deno eval.

Returns: Promise<RunCodeResponse>

type RunCodeResponse<Result> = {
  result: Result;      // Parsed JSON from stdout (if valid JSON)
  stdout?: string;     // Raw stdout output
  stderr?: string;     // Raw stderr output
  statusCode?: number; // Exit code
};

vm.deno.install(options?)

Installs packages using Deno. Supports both npm packages and JSR (Deno's native registry).

// Install from deno.json in current directory
await vm.deno.install();

// Install from deno.json in specific directory
await vm.deno.install({ directory: "/app" });

// Install npm packages (auto-prefixed with npm:)
await vm.deno.install({ deps: ["lodash-es", "express"] });

// Install JSR packages (use jsr: prefix)
await vm.deno.install({ deps: ["jsr:@std/path", "jsr:@std/fs"] });

// Install with specific versions
await vm.deno.install({ deps: { "lodash-es": "^4.0.0" } });

// Install as dev dependencies
await vm.deno.install({ deps: ["typescript"], dev: true });

// Install globally
await vm.deno.install({ global: true, deps: ["jsr:@std/cli"] });

Returns: Promise<InstallResult>

type InstallResult = {
  success: boolean;
  stdout?: string;
  stderr?: string;
};

JSR Packages

Deno has native support for JSR (JavaScript Registry), which hosts TypeScript-first packages including the Deno standard library.

const deno = new VmDeno();
const spec = new VmSpec().with("deno", deno);
const { vm } = await freestyle.vms.create({ spec });

// Install @std/path from JSR
await vm.deno.install({ deps: ["jsr:@std/path"] });

// Use it in code
const res = await vm.deno.runCode({
  code: `
    import * as path from "jsr:@std/path";
    console.log(JSON.stringify({
      join: path.join("foo", "bar", "baz"),
      basename: path.basename("/home/user/file.txt"),
    }));
  `,
});

Workspaces and Tasks

Use the Deno builder to attach a workspace and run a Deno task as a managed systemd service.

import { Freestyle, VmSpec } from "freestyle";
import { VmDeno } from "@freestyle-sh/with-deno";

const freestyle = new Freestyle();

const deno = new VmDeno();
const workspace = deno.workspace({ path: "/root/app", install: true });
const appTask = workspace.task("start", {
  env: {
    HOST: "0.0.0.0",
  },
});

const spec = new VmSpec()
  .with("deno", deno)
  .repo("https://github.com/deco-sites/storefront", "/root/app")
  .with("workspace", workspace)
  .with("app", appTask)
  .snapshot()
  .waitFor("curl http://localhost:8000")
  .snapshot();

const { repoId } = await freestyle.git.repos.create({
  source: {
    url: "https://github.com/deco-sites/storefront",
  },
});

const domain = `${crypto.randomUUID()}.style.dev`;

const { vm } = await freestyle.vms.create({
  spec,
  domains: [{ domain, vmPort: 8000 }],
  git: {
    repos: [{ repo: repoId, path: "/root/app" }],
  },
});

// Task instance comes from .with("app", appTask)
const recentLogs = await vm.app.logs();
console.log(recentLogs);

Workspace API

const workspace = deno.workspace({
  path: "/root/app",
  install: true,
});
  • path: Working directory for deno install and task execution.
  • install: When true, runs deno install in the workspace during VM startup.

Task API

const task = workspace.task("start", {
  env: { HOST: "0.0.0.0" },
  serviceName: "my-deno-app",
});
  • name: Task name from deno.json.
  • env: Optional environment variables for the task service.
  • serviceName: Optional explicit systemd service name.

When added to the spec with .with("app", task), you can access task logs with vm.app.logs().

Documentation