coreybutler / coreybutler/node-windows

Change daemon directory

Open
#269 6 comments 7 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
2.9k
Forks
368
PR merge metrics
No merged PRs in 30d

Description

I put my source files in `/src` similar to many other projects and since my `index.js` in under `/src` the output daemon folder will be created as `/src/daemon`. I need to specify the output daemon folder in node-windows config like `daemonDir`. If you add this option it's very good.

Meanwhile, I solved my problem as follows:

I changed `node_modules\node-windows\lib\daemon.js` file at line 258 from:
```
_directory: {
enumerable: false,
writable: true,
configurable: false,
value: config.script !== null ? path.dirname(config.script) : null
},
```
to
```
_directory: {
enumerable: false,
writable: true,
configurable: false,
value: config.daemonDir !== null ? path.dirname(config.daemonDir) : null
},
```

And specify `daemonDir` at config:
```
var svc = new Service({
name: "My Server",
description: "My Server",
script: "src/index.js",
daemonDir: "./",
});
```

Contributor guide

Open the contributing guide

Research direction

Start in lib/daemon.js around line 258, where the daemon directory is derived from config.script. Review the proposed daemonDir configuration shown in the issue and verify how the daemon output path is used. Done means the service accepts daemonDir and creates or uses the daemon folder at that configured location.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
operating-systems
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.