nodeutil

package
v0.3.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsurePluginInstalled

func EnsurePluginInstalled(source string) error

EnsurePluginInstalled makes sure the npm plugin package is available globally. It installs both the source package (CLI wrapper) and the actual runtime plugin.

func GetNpmChecksum

func GetNpmChecksum(source string) (string, error)

GetNpmChecksum fetches the integrity hash of an npm package from the registry.

func ResolveGlobalNodeModules

func ResolveGlobalNodeModules() string

ResolveGlobalNodeModules finds the global npm node_modules directory.

func ResolveNodeRunner

func ResolveNodeRunner() string

ResolveNodeRunner returns "tsx" if available globally, otherwise "node". tsx is needed because OpenClaw plugins are ESM + TypeScript. If tsx is not found, it prompts the user for consent before installing globally.

func ResolvePluginPackage

func ResolvePluginPackage(source string) string

ResolvePluginPackage derives the actual plugin package name from the source. CLI wrapper packages like "@tencent-weixin/openclaw-weixin-cli" need the runtime package "@tencent-weixin/openclaw-weixin" to be installed instead.

func VerifyChecksum

func VerifyChecksum(source, expected string) error

VerifyChecksum compares the installed package's npm integrity hash against the expected checksum from the manifest. Returns nil if match or if no checksum was recorded (graceful degradation).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL