Skip to content

Reference ​

ts
import { definitionRunsProgram, diskFiles, platformServiceManager, runCommand, serviceDefinition, type ServiceSpec } from '@adecore/service';

Tables ​

Definitions lists the fields of ServiceSpec. Managers lists the members of ServiceManager, and each platform's section lists its options: LaunchdOptions, SystemdOptions and TaskSchedulerOptions.

PlatformServiceOptions ​

OptionType
launchdLaunchdOptionsUsed on darwin.
systemdSystemdOptionsUsed on linux.
taskSchedulerTaskSchedulerOptions, optionalUsed on win32. Without it there is no manager on Windows.

Which function runs where ​

Functiondarwinlinuxwin32Elsewhere
serviceDefinition(platform, spec)launchAgentPlistsystemdUnitscheduledTaskThrows
platformServiceManager(platform, options)launchdManagersystemdManagertaskSchedulerManager, or nullnull

Exports ​

Every name each entry point exports, read from its source. Anything not listed is internal and may change in any release.

@adecore/service ​

Every name of the four entry points below, from one import.

NameKindSource
definitionRunsProgramconstindex
launchAgentPlistconstindex
scheduledTaskconstindex
scheduledTaskScriptconstindex
systemdUnitconstindex
ServiceSpectypeindex
launchdManagerconstindex
systemdManagerconstindex
taskSchedulerManagerconstindex
CommandResulttypeindex
CommandRunnertypeindex
LaunchdOptionstypeindex
ServiceFilestypeindex
ServiceManagertypeindex
SystemdOptionstypeindex
TaskSchedulerOptionstypeindex
platformServiceManagerconstindex
serviceDefinitionconstindex
PlatformServiceOptionstypeindex
diskFilesconstindex
runCommandconstindex

@adecore/service/definitions ​

The spec and the functions that turn it into a definition. Imports nothing, so it runs anywhere.

NameKindSource
ServiceSpectypedefinitions
launchAgentPlistfunctiondefinitions
systemdUnitfunctiondefinitions
scheduledTaskfunctiondefinitions
scheduledTaskScriptfunctiondefinitions
definitionRunsProgramfunctiondefinitions

@adecore/service/manager ​

The three managers and the adapter types. Node or Bun.

NameKindSource
CommandResulttypemanager
CommandRunnertypemanager
ServiceFilestypemanager
ServiceManagertypemanager
LaunchdOptionstypemanager
launchdManagerfunctionmanager
SystemdOptionstypemanager
systemdManagerfunctionmanager
TaskSchedulerOptionstypemanager
taskSchedulerManagerfunctionmanager

@adecore/service/platform ​

The manager and the definition for a process.platform. Node or Bun.

NameKindSource
PlatformServiceOptionstypeplatform
platformServiceManagerfunctionplatform
serviceDefinitionfunctionplatform

@adecore/service/system ​

runCommand and diskFiles, the adapters that touch the machine. Node or Bun.

NameKindSource
runCommandfunctionsystem
diskFilesconstsystem

Licenses and third-party notices are listed in each package.