New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@hakobu/hakobu

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hakobu/hakobu

Package your Node.js project into an executable

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@hakobu/hakobu

The modern Node.js packager — the successor to @yao-pkg/pkg. Package your Node.js project into a standalone executable that runs without Node.js installed.

Install

npm install @hakobu/hakobu --save-dev

Or globally:

npm install -g @hakobu/hakobu

Quick Start

# Package the current project
npx @hakobu/hakobu .

# Package with a specific target
npx @hakobu/hakobu . --target node24-linux-x64

# Multi-target build
npx @hakobu/hakobu . --target node24-linux-x64,node24-macos-arm64,node24-win-x64

CLI Usage

hakobu <project-root> [options]

Commands:
  hakobu <project-root>                Package a project
  hakobu targets                       Show available targets and cache
  hakobu inspect <project-root>        Analyze a project without packaging
  hakobu doctor <project-root>         Check if a project is ready to package

Options:
  --target <spec>       Target(s), comma-separated. Use 'all' for all published targets
  --output <path>       Output executable path
  --entry <file>        Entry file (relative to project root)
  --debug, -d           Show detailed packaging diagnostics
  --help, -h            Show help
  --version, -v         Show version

Bundle Mode:
  --bundle [name]       Pre-bundle with Rolldown before packaging
  --external <mod>      Keep module external when bundling (repeatable)

Advanced:
  --bytecode            Compile JS to V8 bytecode before packaging
  --compress <algo>     Compress snapshot (Brotli or GZip)
  --options <flags>     Bake V8 flags into executable (comma-separated)
  --build, -b           Force local build of base binary

Targets

Target format: node24-{platform}-{arch}

TargetTier
node24-linux-x641
node24-linux-arm641
node24-win-x641
node24-macos-arm641
node24-macos-x642
node24-linuxstatic-x642
node24-win-arm642

Use --target all to build for all published targets.

Configuration

Configure via the "hakobu" field in package.json:

{
  "hakobu": {
    "entry": "src/index.js",
    "assets": ["templates/**", "views/**"],
    "target": "node24-linux-x64",
    "output": "dist/my-app"
  }
}

The legacy "pkg" field is accepted with migration warnings. CLI flags override package.json config.

Bundle Mode

For TypeScript and monorepo projects, use --bundle to pre-bundle with Rolldown before packaging:

npx @hakobu/hakobu . --bundle --entry src/cli.ts --external electron

See Bundle Mode documentation for details.

Platform Features

macOS Signing & Notarization

npx @hakobu/hakobu . --target node24-macos-arm64 \
  --sign-identity "Developer ID Application: ..." \
  --notarize

macOS App Bundle

npx @hakobu/hakobu . --target node24-macos-arm64 \
  --app-bundle --bundle-id com.example.my-app

Windows PE Metadata

npx @hakobu/hakobu . --target node24-win-x64 \
  --product-name "My App" \
  --company-name "My Company" \
  --file-version 1.0.0 \
  --icon app.ico

Linux AppDir / AppImage

npx @hakobu/hakobu . --target node24-linux-x64 \
  --appdir --desktop-name "My App"

npx @hakobu/hakobu . --target node24-linux-x64 \
  --appimage --desktop-name "My App"

Programmatic API

import { exec } from '@hakobu/hakobu';

await exec(['.', '--target', 'node24-linux-x64', '--output', 'dist/app']);

Migrating from @yao-pkg/pkg

npm uninstall @yao-pkg/pkg
npm install @hakobu/hakobu --save-dev

Rename the "pkg" field to "hakobu" in your package.json. The legacy "pkg" field still works with migration warnings.

See the Migration Guide for full details.

Documentation

License

MIT

FAQs

Package last updated on 30 Mar 2026

Did you know?

Socket

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.

Install

Related posts