pkg

(★ 24,354)

Package your Node.js project into an executable

File Explorer

  • .eslintignore
  • .eslintrc
  • .gitignore
  • .prettierignore
  • .yarnrc
  • LICENSE
  • package.json
  • README.md
  • tsconfig.json
  • yarn.lock

# Installation Guide

node
Prerequisites

Setup Steps

npm install -g pkg

Install the pkg CLI tool globally.

pkg index.js

Package your Node.js project into an executable.

Key Commands

pkg -t node16-win,node18-linux index.js

Package a Node.js project into executables for target platforms.

pkg has been deprecated with 5.8.1 as the last release; consider using Node.js 21's built-in single executable applications.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

pkg

View Details ▼

Package management utility for Termux.

pkg {{[up|upgrade]}}

Upgrade all installed packages:

pkg install {{package}}

Install a new package:

tldr pkg_add

View documentation for installing/updating packages:

🔍

host

View Details ▼

Lookup Domain Name Server.
See also: `dig`, `resolvectl`, `nslookup`.

host {{domain}}

Lookup A, AAAA, and MX records of a domain:

host -t {{field}} {{domain}}

Lookup a field (CNAME, TXT, ...) of a domain:

host {{ip_address}}

Reverse lookup an IP:

🔍

node

View Details ▼

Server-side JavaScript platform (Node.js).

node {{path/to/file}}

Run a JavaScript file:

node

Start a REPL (interactive shell):

node --watch {{path/to/file}}

Execute the specified file restarting the process when an imported file is changed (requires Node.js version 18.11+):

🔍

npm install

View Details ▼

Install Node packages.

npm {{[i|install]}}

Install dependencies listed in `package.json`:

npm {{[i|install]}} {{package_name}}@{{version}}

Download a specific version of a package and add it to the list of dependencies in `package.json`:

npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}

Download the latest version of a package and add it to the list of dev dependencies in `package.json`:

🔍

codesign

View Details ▼

Create and manipulate code signatures for macOS.

codesign --sign "{{My Company Name}}" {{path/to/application_file.app}}

Sign an application with a certificate:

codesign --verify {{path/to/application_file.app}}

Verify the certificate of an application:

// repository documentation