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
| Option | Type | |
|---|---|---|
launchd | LaunchdOptions | Used on darwin. |
systemd | SystemdOptions | Used on linux. |
taskScheduler | TaskSchedulerOptions, optional | Used on win32. Without it there is no manager on Windows. |
Which function runs where
| Function | darwin | linux | win32 | Elsewhere |
|---|---|---|---|---|
serviceDefinition(platform, spec) | launchAgentPlist | systemdUnit | scheduledTask | Throws |
platformServiceManager(platform, options) | launchdManager | systemdManager | taskSchedulerManager, or null | null |
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.
| Name | Kind | Source |
|---|---|---|
definitionRunsProgram | const | index |
launchAgentPlist | const | index |
scheduledTask | const | index |
scheduledTaskScript | const | index |
systemdUnit | const | index |
ServiceSpec | type | index |
launchdManager | const | index |
systemdManager | const | index |
taskSchedulerManager | const | index |
CommandResult | type | index |
CommandRunner | type | index |
LaunchdOptions | type | index |
ServiceFiles | type | index |
ServiceManager | type | index |
SystemdOptions | type | index |
TaskSchedulerOptions | type | index |
platformServiceManager | const | index |
serviceDefinition | const | index |
PlatformServiceOptions | type | index |
diskFiles | const | index |
runCommand | const | index |
@adecore/service/definitions
The spec and the functions that turn it into a definition. Imports nothing, so it runs anywhere.
| Name | Kind | Source |
|---|---|---|
ServiceSpec | type | definitions |
launchAgentPlist | function | definitions |
systemdUnit | function | definitions |
scheduledTask | function | definitions |
scheduledTaskScript | function | definitions |
definitionRunsProgram | function | definitions |
@adecore/service/manager
The three managers and the adapter types. Node or Bun.
| Name | Kind | Source |
|---|---|---|
CommandResult | type | manager |
CommandRunner | type | manager |
ServiceFiles | type | manager |
ServiceManager | type | manager |
LaunchdOptions | type | manager |
launchdManager | function | manager |
SystemdOptions | type | manager |
systemdManager | function | manager |
TaskSchedulerOptions | type | manager |
taskSchedulerManager | function | manager |
@adecore/service/platform
The manager and the definition for a process.platform. Node or Bun.
| Name | Kind | Source |
|---|---|---|
PlatformServiceOptions | type | platform |
platformServiceManager | function | platform |
serviceDefinition | function | platform |
@adecore/service/system
runCommand and diskFiles, the adapters that touch the machine. Node or Bun.
| Name | Kind | Source |
|---|---|---|
runCommand | function | system |
diskFiles | const | system |