esbuild (OpenBSD 64-bit Binary)

0.15.18 · active · verified Sun Apr 19

esbuild is an extremely fast JavaScript bundler, minifier, and transformer, primarily known for its speed due to being written in Go. It processes JavaScript, TypeScript, JSX, TSX, CSS, and JSON files, compiling them into optimized bundles for various environments like web browsers or Node.js. Key features include tree-shaking, source map generation, and modern syntax transformation. The project releases frequently, with the current stable version around `0.28.x` as of April 2026, often seeing multiple patch and minor updates within a month. Its key differentiators include performance (often 10-100x faster than competitors), a simple API, and its cross-platform nature. This `esbuild-openbsd-64` package specifically provides the native 64-bit binary for OpenBSD systems. It is typically installed automatically by npm as an optional dependency of the main `esbuild` npm package based on the user's operating system and architecture.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic TypeScript project bundling and minification using esbuild's JavaScript API. It creates a simple `src` directory with two files, then configures esbuild to bundle them into a minified, sourcemapped output file for the browser.

import { build } from 'esbuild';
import path from 'path';
import fs from 'fs';

// Create dummy source files for the example
const srcDir = path.join(process.cwd(), 'src');
const distDir = path.join(process.cwd(), 'dist');

if (!fs.existsSync(srcDir)) fs.mkdirSync(srcDir);
if (!fs.existsSync(distDir)) fs.mkdirSync(distDir);

fs.writeFileSync(path.join(srcDir, 'index.ts'), `
  // src/index.ts
  import { greet } from './utils';
  console.log(greet('World from esbuild!'));
`);
fs.writeFileSync(path.join(srcDir, 'utils.ts'), `
  // src/utils.ts
  export function greet(name: string): string {
    return \`Hello, \${name} from esbuild!\`;
  }
`);

async function bundleApp() {
  try {
    console.log('Starting esbuild...');
    const result = await build({
      entryPoints: [path.join(srcDir, 'index.ts')],
      bundle: true,
      minify: true,
      sourcemap: true,
      outfile: path.join(distDir, 'bundle.js'),
      platform: 'browser', // or 'node' depending on target environment
      target: ['es2020', 'chrome88'], // Specify target environments
      logLevel: 'info', // Adjust log verbosity
    });
    console.log('esbuild completed successfully.');
    // Optionally, inspect the output or metadata
    // console.log(result.metafile);
  } catch (error: any) {
    console.error('esbuild failed:');
    if (error.errors) {
      error.errors.forEach((err: any) => console.error(err.text));
    } else {
      console.error(error);
    }
    process.exit(1);
  }
}

bundleApp();

view raw JSON →