{"id":12727,"library":"esbuild-openbsd-64","title":"esbuild (OpenBSD 64-bit Binary)","description":"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.","status":"active","version":"0.15.18","language":"javascript","source_language":"en","source_url":"https://github.com/evanw/esbuild","tags":["javascript"],"install":[{"cmd":"npm install esbuild-openbsd-64","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-openbsd-64","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-openbsd-64","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package provides the native binary executable. The primary JavaScript API for orchestrating esbuild builds and transformations is provided by the main `esbuild` npm package.","package":"esbuild","optional":false}],"imports":[{"note":"The `build` function is the primary asynchronous API for bundling files. While CommonJS `require` works, ESM `import` is the modern approach and recommended when possible, especially in TypeScript projects.","wrong":"const { build } = require('esbuild')","symbol":"build","correct":"import { build } from 'esbuild'"},{"note":"The `transform` function is used for single-file transformations like minification, TypeScript/JSX compilation, or converting newer JS to older JS, without bundling.","symbol":"transform","correct":"import { transform } from 'esbuild'"},{"note":"The `serve` function provides a local development server with optional watch mode and live reloading capabilities.","symbol":"serve","correct":"import { serve } from 'esbuild'"},{"note":"When importing types like `BuildOptions`, use `import type` for clarity and to ensure they are stripped during compilation.","wrong":"import { BuildOptions } from 'esbuild'","symbol":"BuildOptions","correct":"import { type BuildOptions } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport path from 'path';\nimport fs from 'fs';\n\n// Create dummy source files for the example\nconst srcDir = path.join(process.cwd(), 'src');\nconst distDir = path.join(process.cwd(), 'dist');\n\nif (!fs.existsSync(srcDir)) fs.mkdirSync(srcDir);\nif (!fs.existsSync(distDir)) fs.mkdirSync(distDir);\n\nfs.writeFileSync(path.join(srcDir, 'index.ts'), `\n  // src/index.ts\n  import { greet } from './utils';\n  console.log(greet('World from esbuild!'));\n`);\nfs.writeFileSync(path.join(srcDir, 'utils.ts'), `\n  // src/utils.ts\n  export function greet(name: string): string {\n    return \\`Hello, \\${name} from esbuild!\\`;\n  }\n`);\n\nasync function bundleApp() {\n  try {\n    console.log('Starting esbuild...');\n    const result = await build({\n      entryPoints: [path.join(srcDir, 'index.ts')],\n      bundle: true,\n      minify: true,\n      sourcemap: true,\n      outfile: path.join(distDir, 'bundle.js'),\n      platform: 'browser', // or 'node' depending on target environment\n      target: ['es2020', 'chrome88'], // Specify target environments\n      logLevel: 'info', // Adjust log verbosity\n    });\n    console.log('esbuild completed successfully.');\n    // Optionally, inspect the output or metadata\n    // console.log(result.metafile);\n  } catch (error: any) {\n    console.error('esbuild failed:');\n    if (error.errors) {\n      error.errors.forEach((err: any) => console.error(err.text));\n    } else {\n      console.error(error);\n    }\n    process.exit(1);\n  }\n}\n\nbundleApp();","lang":"typescript","description":"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."},"warnings":[{"fix":"Always pin exact versions (`\"esbuild\": \"0.28.0\"`) or use patch-only version ranges (`\"esbuild\": \"~0.28.0\"`) in `package.json` to prevent automatic major-like updates that may contain breaking changes.","message":"esbuild `v0.27.0` (and other pre-1.0 versions) included deliberate backwards-incompatible changes. The project recommends pinning the exact version in `package.json` or using a version range that only accepts patch upgrades (e.g., `^0.26.0` or `~0.26.0`) to avoid unexpected breakages.","severity":"breaking","affected_versions":">=0.27.0"},{"fix":"Install `esbuild` directly via `npm install esbuild`. Only use `@esbuild/platform-arch` packages if you explicitly need to manage platform-specific binaries for cross-compilation or specific deployment targets.","message":"This package (`esbuild-openbsd-64`) is a platform-specific binary. For general use, you should typically install the main `esbuild` package, which automatically selects and installs the correct platform binary for your system. Directly installing platform-specific packages is only needed in advanced scenarios, like when managing multiple target platforms in a single environment.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Review esbuild's documentation on plugins for 'onLoad' and 'onResolve' hooks. If a specific feature isn't supported by existing plugins, custom logic might be needed, or consider integrating esbuild with other tools for specific transformations.","message":"esbuild's plugin system differs from Webpack/Rollup, relying on 'onLoad' and 'onResolve' callbacks rather than a traditional plugin API. While powerful, this means certain complex transformations or integrations might require a different approach or may not be directly supported as a plugin.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure your operating system meets the minimum requirements for the esbuild version you are using. If an upgrade isn't possible, you may need to pin to an older esbuild version or consider `esbuild-wasm` as a less performant but more compatible alternative.","message":"Version `0.27.0` raised operating system requirements. For instance, Linux now requires kernel version 3.2+ and macOS 12+ (Monterey). Older systems may fail to run the native binary.","severity":"breaking","affected_versions":">=0.27.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you are running `npm install esbuild` on the target machine with the correct Node.js version and architecture. Delete `node_modules` and `package-lock.json` and run `npm install` again. For Docker, ensure the `npm install` step runs inside the final container environment. If using a specific `esbuild-platform-arch` package, verify it matches your system.","cause":"The esbuild package could not find a compatible native binary for your operating system and architecture, or the installed binary is corrupted. This often happens in cross-platform development environments or when `node_modules` is copied between different OS/architectures.","error":"Error: No native build was found for platform..."},{"fix":"Verify the module is installed (e.g., `npm install some-module`). Check the import path for typos or case sensitivity. If the module is a Node.js built-in and you're targeting the browser, ensure `platform: 'node'` is set in esbuild options, or mark it as `external` if it should not be bundled.","cause":"esbuild cannot find an imported module. This can be due to a missing package, incorrect import path, or an external module that esbuild isn't configured to handle.","error":"✘ [ERROR] Could not resolve \"some-module\" src/index.js:X:Y:"},{"fix":"Ensure `entryPoints` is an array of strings, even if you only have a single entry point: `entryPoints: ['src/index.ts']`.","cause":"The `entryPoints` option in the `build` configuration was provided with an incorrect type, often a string instead of an array of strings.","error":"Error: [esbuild] Argument 'entryPoints' must be an array"}],"ecosystem":"npm"}