Skip to content

Commit 5c6c110

Browse files
committed
Updated dependencies. Remediates optimist vulnerabilities.
1 parent 2663a3e commit 5c6c110

File tree

8 files changed

+151
-15
lines changed

8 files changed

+151
-15
lines changed

example/helloworld.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var http = require('http');
2+
23
var server = http.createServer(function (req, res) {
34
res.writeHead(200, {'Content-Type': 'text/plain'});
45
//res.end(JSON.stringify(process.env));

example/install.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var Service = require('../').Service;
1+
var Service = require('node-windows').Service;
2+
var dir = require('path').join(process.cwd(), 'helloworld.js')
23

34
// Create a new service object
45
var svc = new Service({
56
name:'Hello World',
67
description: 'The nodejs.org example web server.',
7-
script: require('path').join('C:\path\to', 'helloworld.js'),
8+
script: dir,
89
env:{
910
name: "NODE_ENV",
1011
value: "production"
@@ -29,4 +30,5 @@ svc.on('start',function(){
2930
});
3031

3132
// Install the script as a service.
33+
console.log("Installing to", dir)
3234
svc.install();

example/package-lock.json

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"node-windows": "^1.0.0-beta.7"
4+
}
5+
}

example/uninstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var Service = require('../').Service;
33
// Create a new service object
44
var svc = new Service({
55
name:'Hello World',
6-
script: require('path').join(__dirname,'helloworld.js')
6+
script: require('path').join(process.cwd(),'helloworld.js')
77
});
88

99
// Listen for the "uninstall" event so we know when it's done.

lib/daemon.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ var daemon = function(config){
155155
configurable: false,
156156
value: config.hasOwnProperty('maxRetries') ? config.maxRetries : null
157157
},
158-
158+
159159
/**
160160
* @cfg {Boolean} [stopparentfirst=false]
161161
* Allow the service to shutdown cleanly.
@@ -164,9 +164,9 @@ var daemon = function(config){
164164
enumerable: true,
165165
writable: false,
166166
configurable: false,
167-
value: config.stopparentfirst
167+
value: config.hasOwnProperty('stopparentfirst') ? config.stopparentfirst : false
168168
},
169-
169+
170170
/**
171171
* @cfg {Number} [stoptimeout=30]
172172
* How long to wait in seconds before force killing the application.
@@ -178,18 +178,18 @@ var daemon = function(config){
178178
configurable: false,
179179
value: config.hasOwnProperty('stoptimeout') ? config.stoptimeout : 30
180180
},
181-
181+
182182
/**
183-
* @cfg {string} [nodeOptions='--harmony']
183+
* @cfg {string} [nodeOptions]
184184
* Options to be passed to the node process.
185185
*/
186186
nodeOptions: {
187187
enumerable: true,
188188
writable: false,
189189
configurable: false,
190-
value: config.nodeOptions || '--harmony'
190+
value: config.nodeOptions
191191
},
192-
192+
193193
/**
194194
* @cfg {string} [scriptOptions='']
195195
* Options to be passed to the script.
@@ -200,7 +200,7 @@ var daemon = function(config){
200200
configurable: false,
201201
value: config.scriptOptions || ''
202202
},
203-
203+
204204
/**
205205
* @cfg {Number} [maxRestarts=3]
206206
* The maximum number of restarts within a 60 second period before haulting the process.

package-lock.json

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-windows",
3-
"version": "1.0.0-beta.6",
3+
"version": "1.0.0-beta.7",
44
"description": "Support for Windows services, event logging, UAC, and several helper methods for interacting with the OS.",
55
"keywords": [
66
"ngn",
@@ -15,12 +15,11 @@
1515
"task"
1616
],
1717
"author": "Corey Butler <[email protected]>",
18-
"devDependencies": {},
1918
"main": "lib/node-windows.js",
2019
"preferGlobal": true,
2120
"dependencies": {
22-
"@author.io/arg": "^1.3.11",
23-
"xml": "0.0.12"
21+
"@author.io/arg": "1.3.22",
22+
"xml": "1.0.1"
2423
},
2524
"readmeFilename": "README.md",
2625
"scripts": {},

0 commit comments

Comments
 (0)