Skip to content

Commit

Permalink
Updated dependencies. Remediates optimist vulnerabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Mar 21, 2022
1 parent 2663a3e commit 5c6c110
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 15 deletions.
1 change: 1 addition & 0 deletions example/helloworld.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var http = require('http');

var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
//res.end(JSON.stringify(process.env));
Expand Down
6 changes: 4 additions & 2 deletions example/install.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var Service = require('../').Service;
var Service = require('node-windows').Service;
var dir = require('path').join(process.cwd(), 'helloworld.js')

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

// Install the script as a service.
console.log("Installing to", dir)
svc.install();
86 changes: 86 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"node-windows": "^1.0.0-beta.7"
}
}
2 changes: 1 addition & 1 deletion example/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Service = require('../').Service;
// Create a new service object
var svc = new Service({
name:'Hello World',
script: require('path').join(__dirname,'helloworld.js')
script: require('path').join(process.cwd(),'helloworld.js')
});

// Listen for the "uninstall" event so we know when it's done.
Expand Down
16 changes: 8 additions & 8 deletions lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ var daemon = function(config){
configurable: false,
value: config.hasOwnProperty('maxRetries') ? config.maxRetries : null
},

/**
* @cfg {Boolean} [stopparentfirst=false]
* Allow the service to shutdown cleanly.
Expand All @@ -164,9 +164,9 @@ var daemon = function(config){
enumerable: true,
writable: false,
configurable: false,
value: config.stopparentfirst
value: config.hasOwnProperty('stopparentfirst') ? config.stopparentfirst : false
},

/**
* @cfg {Number} [stoptimeout=30]
* How long to wait in seconds before force killing the application.
Expand All @@ -178,18 +178,18 @@ var daemon = function(config){
configurable: false,
value: config.hasOwnProperty('stoptimeout') ? config.stoptimeout : 30
},

/**
* @cfg {string} [nodeOptions='--harmony']
* @cfg {string} [nodeOptions]
* Options to be passed to the node process.
*/
nodeOptions: {
enumerable: true,
writable: false,
configurable: false,
value: config.nodeOptions || '--harmony'
value: config.nodeOptions
},

/**
* @cfg {string} [scriptOptions='']
* Options to be passed to the script.
Expand All @@ -200,7 +200,7 @@ var daemon = function(config){
configurable: false,
value: config.scriptOptions || ''
},

/**
* @cfg {Number} [maxRestarts=3]
* The maximum number of restarts within a 60 second period before haulting the process.
Expand Down
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-windows",
"version": "1.0.0-beta.6",
"version": "1.0.0-beta.7",
"description": "Support for Windows services, event logging, UAC, and several helper methods for interacting with the OS.",
"keywords": [
"ngn",
Expand All @@ -15,12 +15,11 @@
"task"
],
"author": "Corey Butler <[email protected]>",
"devDependencies": {},
"main": "lib/node-windows.js",
"preferGlobal": true,
"dependencies": {
"@author.io/arg": "^1.3.11",
"xml": "0.0.12"
"@author.io/arg": "1.3.22",
"xml": "1.0.1"
},
"readmeFilename": "README.md",
"scripts": {},
Expand Down

0 comments on commit 5c6c110

Please sign in to comment.