Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beauallison/homebrew-services
Control Homebrew services for OSX
https://github.com/beauallison/homebrew-services
brew homebrew nodejs osx
Last synced: about 1 month 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-28T13:33:24.000Z (over 6 years ago)
- Last Synced: 2024-04-24T21:01:29.720Z (8 months ago)
- Topics: brew, homebrew, nodejs, osx
- Language: JavaScript
- Size: 52.7 KB
- Stars: 5
- Watchers: 2
- 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