JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 102
  • Score
    100M100P100Q78760F
  • License MIT

Allows you to control system services using the systemctl command easily and asynchronously

Package Exports

  • systemctl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (systemctl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

systemctl

This simple node module allows you to control system services using the systemctl command easily and asynchronously.

Requirements

  • Archlinux or another OS which uses the systemctl command

Usage

There are two ways to use systemctl depending on your needs:

1. Utilize the helper functions

// For ES6:
import systemctl from 'systemctl'
// For ES5:
var systemctl = require('systemctl')

// Start a service
systemctl.start('service-name').then(output => console.log)

// Check if a service is enabled
systemctl.isEnabled('service-name').then(enabled => {
    console.log((enabled ? 'Enabled' : 'Not enabled'));
})

2. Utilize the systemctl/run module for lower-level access

// For ES6:
import systemctl from 'systemctl/run'
// For ES5:
var systemctl = require('systemctl/run')

// Start a service
systemctl('start', 'service-name').then(output => console.log)