# service-manager

> A service manager for linux(and windows SOON(TM)) scripts

Latest version **0.2.0** (published 2013-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install service-manager
pnpm add service-manager
yarn add service-manager
bun add service-manager
```

Provides the command `servicemgr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2013-09-14 |
| First published | 2013-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Johan Jatko |
| Maintainers | armedguy |
| Keywords | service, linux, sysvinit, windows, net |

## Links

- npm: https://www.npmjs.com/package/service-manager
- Repository: https://github.com/ArmedGuy/node-service-manager
- Issues: https://github.com/ArmedGuy/node-service-manager/issues
- npm.io page: https://npm.io/package/service-manager

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2013-09-14
- 0.1.17 — 2013-09-10
- 0.1.9 — 2013-09-10
- 0.1.8 — 2013-09-07

## README

# node-service-manager
[![Build Status](https://travis-ci.org/ArmedGuy/node-service-manager.png?branch=master)](https://travis-ci.org/ArmedGuy/node-service-manager)

A Linux(and soon Windows) Service Manager for node.js


## How to use
Services can be managed in two ways
* Via node.js code using the node-service class
* Via servicemgr that comes with the package(when using npm install -g)



### Creating a new service via node.js
```node
var service = require('service-manager');
var svc = new service.Service({
  name: "test", // sets the name of the service(will be used in service *name* start in Linux for example)
  displayname: "Test Server", // sets a displayname for the service, defaults to *name*
  description: "This is a test server!", // sets a description for the service
  run: "node", // sets what file to run
  args: ["/root/test-server.js"], // sets file arguments
  output: true, // sets wheter log to console
  log: false // sets wheter linux services should log stdout and stderr
});
```

#### install(callback) or installSync()

Requires atleast *name* and *run* in settings
```node

svc.install(function(isInstalled) {
});

if(svc.installSync()) {
}
```

#### uninstall(callback) or uninstallSync()

Requires atleast *name* in settings
```node

svc.uninstall(function(isUninstalled) {
});

if(svc.uninstallSync() {
}
```
#### start(), stop() and restart()
TODO


### Via the command-line
```bash
servicemgr install test node /root/test-server.js

servicemgr uninstall test
```

---
_Source: https://npm.io/package/service-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
