Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 991 Bytes

File metadata and controls

32 lines (21 loc) · 991 Bytes

Use Bun instead of Node.js, npm, pnpm, or vite.

Applies to "_.ts, _.tsx, _.html, _.css, _.js, _.jsx, package.json files

Bun instead of Node.js

Default to using Bun instead of Node.js.

  • Use bun <file> instead of node <file> or ts-node <file>
  • Use bun test instead of jest or vitest
  • Use bun build <file.html|file.ts|file.css> instead of webpack or esbuild
  • Use bun install instead of npm install or yarn install or pnpm install
  • Use bun run <script> instead of npm run <script> or yarn run <script> or pnpm run <script>
  • Bun automatically loads .env, so don't use dotenv.

OpenCode Plugins

For more information, read the OpenCode Plugin API docs at https://opencode.ai/docs/plugins/

Testing with Bun

Use bun test to run tests.

import { test, expect } from "bun:test";

test("hello world", () => {
  expect(1).toBe(1);
});

For more information, read the Bun API docs in node_modules/bun-types/docs/**.md.