Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanmacfarlane committed Jun 28, 2014
1 parent 13409c6 commit cb8da1a
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SvcInstall

SvcInstall installs services on OSX (launchd) and Linux (inet.d start-stop-dameon)


> - Small and lightweight
> - Avoid coupling with any keep alive or monitoring solution. You Pick ( [SvcHost] is decoupled sister project)
> - Can point a node project, a shell script, etc... Whatever you choose.
> - Package installer with your app or service
## Install:

npm install svcinstall --save



```js
var path = require('path');
var si = require('svcinstall');

var scriptPath = path.join(__dirname, 'server.js');
var options = {
args: ['/usr/local/bin/node', scriptPath],
workingDirectory: path.dirname(scriptPath)
};

var svcinstall = new sim.SvcInstall('myserver', 'com.sample');
svcinstall.install(options, function(err){
if (err) {
console.error('Error:', err.message);
return;
}

console.log('Installed Successfully');

svcinstall.start(function(err) {
if (err) {
console.error('Failed to start: ', err.message);
return;
}

console.log('Started Successfully');
});
});
```

License
----

Apache 2.0

[svchost]:http://github.com/bryanmacfarlane/svchost

0 comments on commit cb8da1a

Please sign in to comment.