https://github.com/beauallison/homebrew-services
Control Homebrew services for OSX
https://github.com/beauallison/homebrew-services
brew homebrew nodejs osx
Last synced: 26 days ago
JSON representation
Control Homebrew services for OSX
- Host: GitHub
- URL: https://github.com/beauallison/homebrew-services
- Owner: beauallison
- License: mit
- Created: 2018-03-07T18:36:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-28T13:33:24.000Z (about 7 years ago)
- Last Synced: 2025-05-15T16:56:35.220Z (about 2 months ago)
- Topics: brew, homebrew, nodejs, osx
- Language: JavaScript
- Size: 52.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Homebrew Services
![Build Status][badgeBuild] ![Coverage Status][badgeCov]
Promised based wrapper to control [brew](https://brew.sh/) services on macOS from Node.js
## Requirements
- OSX with Brew installed
- Node.js 7.6+## Install
```shell
npm install --save homebrew-services
```## Usage
### List all 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' }
})();
```### Start a service
```javascript
const { status } = await brew.start({ service: 'redis' });
console.log(status); // started
```### Stop a service
```javascript
const { status } = await brew.stop({ service: 'redis' });
console.log(status); // stopped
```[badgeBuild]: https://travis-ci.org/beauallison/homebrew-services.svg?branch=master
[badgeCov]: https://coveralls.io/repos/github/beauallison/homebrew-services/badge.svg?branch=master