homebrew-services
Version:
Control Homebrew services from OSX
54 lines (36 loc) • 1.09 kB
Markdown
![Build Status][badgeBuild] ![Coverage Status][badgeCov]
Promised based wrapper to control [brew](https://brew.sh/) services on macOS from Node.js
- OSX with Brew installed
- Node.js 7.6+
```shell
npm install --save homebrew-services
```
Returns a Map of all services and their status of either _started_ or _stopped_.
```javascript
const brew = require('homebrew-services');
(async () => {
const { services } = await brew.list();
console.log(services);
// Map {
// 'cassandra' => 'stopped',
// 'redis' => 'started' }
})();
```
```javascript
const { status } = await brew.start({ service: 'redis' });
console.log(status); // started
```
```javascript
const { status } = await brew.stop({ service: 'redis' });
console.log(status); // stopped
```
<!-- Links -->
[]: https://travis-ci.org/beauallison/homebrew-services.svg?branch=master
[]: https://coveralls.io/repos/github/beauallison/homebrew-services/badge.svg?branch=master