Imports and Package Management (upcoming)
// @zw-run-locally
// Use desktop automation in ZeroWork
import { execSync } from "child_process";
import { keyboard } from "@computer-use/nut-js";
// Open an editor depending on OS
if (process.platform === "win32") {
execSync("start notepad");
} else if (process.platform === "darwin") {
execSync(`osascript -e 'tell application "TextEdit" to activate' -e 'tell application "TextEdit" to make new document'`);
} else {
execSync("gedit || xed || kate || nano", { shell: "/bin/bash" });
}
// Wait briefly for the editor window to appear
await zw.delay({ min: 2_000 });
// Type into the editor
await keyboard.type("Hello from ZeroWork desktop automation!");1. Imports
Standard Imports
Imports with zw.import()
zw.import() At a Glance
Examples
Import Option Details
Supported Package Inputs
Special Package Types
Built-in Packages
Pure ESM Packages
Native Packages
Reusing References
2. Package Management
At a Glance
Whatβs a Package ID?
Examples
3. Local and Browser Execution
How to Use Imported Packages in the Browser
Last updated