
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@freestyle-sh/with-bun
Advanced tools
Bun runtime for Freestyle VMs.
npm install @freestyle-sh/with-bun freestyle
import { freestyle } from "freestyle";
import { VmBun } from "@freestyle-sh/with-bun";
const { vm } = await freestyle.vms.create({
with: {
js: new VmBun(),
},
});
const res = await vm.js.runCode({
code: "console.log(JSON.stringify({ hello: 'world' }));"
});
console.log(res);
// { result: { hello: 'world' }, stdout: '{"hello":"world"}\n', statusCode: 0 }
new VmBun({
version: "1.1.0", // Optional: specific Bun version (default: latest)
})
| Option | Type | Default | Description |
|---|---|---|---|
version | string | undefined | Bun version to install. If not specified, installs the latest version. |
vm.js.runCode({ code: string })Executes JavaScript/TypeScript code in the Bun runtime.
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.js.install(options?)Installs npm packages using Bun.
// Install from package.json in current directory
await vm.js.install();
// Install from package.json in specific directory
await vm.js.install({ directory: "/app" });
// Install specific packages
await vm.js.install({ deps: ["lodash", "express"] });
// Install with specific versions
await vm.js.install({ deps: { "lodash": "^4.0.0", "express": "~5.0.0" } });
// Install as dev dependencies
await vm.js.install({ deps: ["typescript"], dev: true });
// Install globally
await vm.js.install({ global: true, deps: ["typescript"] });
Returns: Promise<InstallResult>
type InstallResult = {
success: boolean;
stdout?: string;
stderr?: string;
};
Use the Bun builder to attach a workspace and run a package script as a managed systemd service.
import { freestyle, VmSpec } from "freestyle";
import { VmBun } from "@freestyle-sh/with-bun";
const SOURCE_REPO = "https://github.com/freestyle-sh/freestyle-next";
const bun = new VmBun();
const workspace = bun.workspace({ path: "/root/app", install: true });
const appTask = workspace.task("dev", {
env: {
HOST: "0.0.0.0",
PORT: "3000",
},
});
const spec = new VmSpec()
.with("bun", bun)
.repo(SOURCE_REPO, "/root/app")
.with("workspace", workspace)
.with("app", appTask)
.snapshot()
.waitFor("curl http://localhost:3000")
.snapshot();
const { repoId } = await freestyle.git.repos.create({
source: {
url: SOURCE_REPO,
},
});
const domain = `${repoId}.style.dev`;
const { vm } = await freestyle.vms.create({
spec,
domains: [{ domain, vmPort: 3000 }],
git: {
repos: [{ repo: repoId, path: "/root/app" }],
},
});
console.log(await vm.app.logs());
const workspace = bun.workspace({
path: "/root/app",
install: true,
});
path: Working directory for bun install and task execution.install: When true, runs bun install in the workspace during VM startup.const task = workspace.task("dev", {
env: {
HOST: "0.0.0.0",
PORT: "3000",
},
serviceName: "my-bun-app",
});
name: Script name from package.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().
FAQs
Bun runtime for [Freestyle](https://freestyle.sh) VMs.
We found that @freestyle-sh/with-bun demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.