sitedock
v0.1.2
Published
Turn any website into a cross-platform desktop app (Mac/Windows/Linux)
Downloads
36
Maintainers
Readme
sitedock
Turn any website into a cross-platform desktop app (Mac / Windows / Linux) — with one command.
sitedock wraps your URL in a minimal Electron app, installs everything it needs, and can package it into an installer (.dmg, .exe, .AppImage) using electron-builder.
Requirements
- Node.js >= 18
- npm
Installation
npm install -g sitedockOr run it without installing:
npx sitedock "https://web.whatsapp.com"Usage
Basic example
sitedock "https://web.whatsapp.com"That's it — this creates a ready-to-run app (name derived from the URL), installs its dependencies, and tells you how to launch it:
cd whatsapp && npm startAdvanced example with custom settings
sitedock --name "MyApp" --icon ./icon.png --width 1280 --height 800 "https://myapp.com"Build a distributable installer
sitedock "https://myapp.com" --package
# → .dmg / .exe / .AppImage written to myapp/dist/CLI options
| Option | Description | Default |
|---|---|---|
| <url> | Website URL to wrap (must be http: or https:) | required |
| -n, --name <name> | App name (window title, product name) | derived from URL |
| -o, --out <dir> | Output directory | current directory |
| -p, --platform <target> | Build target: mac, win, linux, or current | current |
| --icon <path> | App icon — 512x512+ PNG recommended | Electron default |
| --width <px> | Window width (positive integer) | 1200 |
| --height <px> | Window height (positive integer) | 800 |
| --package | Build a distributable installer | off |
| --no-install | Skip npm install (scaffold only) | install on |
| --force | Overwrite the output directory if it already exists | off |
| -V, --version | Print version | |
| -h, --help | Print help | |
What gets generated
<out>/<app-slug>/
├── main.js # Electron main process (loads your URL)
├── package.json # electron + electron-builder config
├── build/icon.png # your icon (only with --icon)
├── node_modules/ # installed automatically (skip with --no-install)
└── dist/ # installers (only with --package)The app name is slugified for the directory name and app id — e.g. --name "My Cool App" produces my-cool-app and com.sitedock.my-cool-app.
Programmatic API
const { build } = require('sitedock');
const { appDir, name, artifact } = await build({
url: 'https://example.com',
name: 'Example', // optional, derived from URL if omitted
outDir: '/path/to/output',
platform: 'current', // 'mac' | 'win' | 'linux' | 'current'
width: 1200,
height: 800,
icon: '/path/to/icon.png', // optional
install: true, // run npm install after scaffolding
packageApp: false, // build installer with electron-builder
force: false, // overwrite non-empty output dir
});Throws on invalid input (non-http(s) URL, empty slug, non-positive dimensions, missing icon file, non-empty output directory without force).
Security defaults in the generated app
contextIsolation: trueandsandbox: true— the loaded site has no access to Node.js- Only
http:/https:URLs can be wrapped - New windows (
target="_blank",window.open) open in the system browser - In-window navigation is pinned to the site's origin; external links open in the system browser
Platform notes
- Cross-platform packaging has limits: building Windows installers on Mac/Linux (and vice versa) may require extra tooling. See the electron-builder multi-platform docs.
- On Windows,
npm/npxare invoked through the shell automatically.
License
MIT
