Promised based wrapper to control brew services on macOS from Node.js
- OSX with Brew installed
- Node.js 7.6+
npm install --save homebrew-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' }
})();
const { status } = await brew.start({ service: 'redis' });
console.log(status); // started
const { status } = await brew.stop({ service: 'redis' });
console.log(status); // stopped