Scripts2026年5月16日·1 分钟阅读

Neutralino.js — Lightweight Desktop App Framework Without Heavy Runtimes

Build cross-platform desktop applications with HTML, CSS, and JavaScript that ship as tiny binaries without bundling a browser engine. Neutralino uses the operating system's native WebView and exposes system APIs through a lightweight runtime.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Neutralino.js Overview
通用 CLI 安装命令
npx tokrepo install a31b5850-5143-11f1-9bc6-00163e2b0d79

Introduction

Neutralino.js is a lightweight desktop application framework that uses the operating system's built-in WebView to render web content instead of bundling Chromium. This approach produces binaries under 5MB (compared to 150MB+ for Electron apps) while still allowing developers to build cross-platform desktop apps with standard web technologies.

What Neutralino.js Does

  • Renders UI using the OS native WebView (WebKit on macOS/Linux, WebView2 on Windows)
  • Provides a JavaScript API for native operations (filesystem, OS info, clipboard, shell, windows)
  • Ships applications as a single lightweight binary plus web resources
  • Supports extensions via child processes for running native code alongside the web app
  • Offers hot-reload during development and a built-in update mechanism for releases

Architecture Overview

Neutralino runs a lightweight C++ server process that hosts web resources and exposes native APIs via a WebSocket connection to the frontend. The UI renders in the platform's native WebView component rather than a bundled browser. Communication between the web frontend and the native backend happens through a bidirectional WebSocket channel, with the frontend calling native functions and receiving events. Extensions can be created as separate processes (in any language) that communicate with the main process via IPC, enabling integration with native libraries.

Self-Hosting & Configuration

  • Initialize projects with neu create which scaffolds the app structure with HTML/JS/CSS
  • Configure the app in neutralino.config.json (window size, permissions, icon, modes)
  • Choose between window mode (native window), browser mode, or cloud mode (remote access)
  • Build for all platforms with neu build producing binaries for Windows, macOS, and Linux
  • Use the built-in updater by hosting a manifest JSON and calling Neutralino.updater.update()

Key Features

  • Tiny application size (2-5MB) compared to Electron's 150MB+ baseline
  • Low memory usage since it leverages the OS WebView rather than spawning a full browser process
  • No dependency on Node.js runtime for the production build
  • Cross-platform builds from a single machine with neu build --release
  • Extension system allows integrating native code in any language via IPC

Comparison with Similar Tools

  • Electron — bundles full Chromium for consistent rendering; Neutralino uses OS WebView for drastically smaller binaries
  • Tauri — similar OS WebView approach with Rust backend; Neutralino uses C++ and offers simpler JavaScript-centric development
  • NW.js — bundles Chromium like Electron; Neutralino avoids the bundled browser entirely
  • WebView (Go/Rust libraries) — lower-level bindings; Neutralino provides a complete framework with CLI, config, and API abstractions
  • PWA/installed web apps — limited native API access; Neutralino provides filesystem, shell, and OS-level capabilities

FAQ

Q: Does the OS WebView create inconsistencies across platforms? A: Some CSS or JavaScript features may behave differently across WebKit (macOS/Linux) and WebView2 (Windows). For most applications, modern web standards are consistent enough. Testing across platforms is recommended for complex UIs.

Q: Can I use React, Vue, or other frameworks with Neutralino? A: Yes. Neutralino serves static web resources, so you can use any frontend framework. Build your framework project and point Neutralino's document root to the output directory.

Q: How do I access native code or libraries? A: Use the extensions system to spawn a child process (Python, Go, Rust, etc.) that communicates with the Neutralino app via IPC. This provides access to any native library without modifying the core runtime.

Q: Is Neutralino suitable for complex desktop applications? A: Neutralino works well for utility apps, dashboards, and tools. For apps requiring deep OS integration (system tray, multiple windows, complex menus), evaluate whether the API surface meets your needs.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产