homebrew-services

Control Homebrew services from OSX

Usage no npm install needed!

<script type="module">
  import homebrewServices from 'https://cdn.skypack.dev/homebrew-services';
</script>

README

Homebrew Services

Build Status Coverage Status

Promised based wrapper to control brew services on macOS from Node.js

Requirements

  • OSX with Brew installed
  • Node.js 7.6+

Install

npm install --save homebrew-services

Usage

List all services

Returns a Map of all services and their status of either started or stopped.

const brew = require('homebrew-services');

(async () => {
  const { services } = await brew.list();

  console.log(services);
  // Map {
  // 'cassandra' => 'stopped',
  // 'redis' => 'started' }
})();

Start a service

const { status } = await brew.start({ service: 'redis' });
console.log(status); // started

Stop a service

const { status } = await brew.stop({ service: 'redis' });
console.log(status); // stopped