Skip to content

updateCommunityPlugin

Updates an installed community plugin to its latest release, the way the community plugin browser’s own Update button does.

Obsidian’s installPlugin writes the release’s files over the installed copy and, when the plugin is running, disables and re-enables it so the new code loads — read from the shipped bundle (1.14.4), not assumed. It reports its own failures (a failed download, a manifest whose id does not match) as a notice and RETURNS rather than throwing, so the installed manifest is re-read afterwards and a version that did not move to the release is thrown as a failure.

Import:

import { updateCommunityPlugin } from '@mnaoumov/obsidian-lib/community-plugins';

Signature:

function updateCommunityPlugin(params: UpdateCommunityPluginParams): Promise<UpdateCommunityPluginResult>

Parameters:

Parameter Type Description
params UpdateCommunityPluginParams The UpdateCommunityPluginParams.

Returns: Promise<UpdateCommunityPluginResult> — A Promise resolving to UpdateCommunityPluginResult.Updated once the latest release is installed, or UpdateCommunityPluginResult.AlreadyUpToDate when the installed copy is not older than it.


Links to this page: