Giter VIP home page Giter VIP logo

qckwinsvc's Introduction

logo Quick Windows Service

dependencies devDependencies npm module

npm

CLI utility that installs/uninstalls a windows service.

This is a wrapper around node-windows.

Installing your service

Interactively

> qckwinsvc
prompt: Service name: Hello
prompt: Service description: Greets the world
prompt: Node script path: C:\my\folder\hello.js
prompt: Should the service get started immediately? (y/n): y
Service installed.
Service started.

Non-interactively

> qckwinsvc --name "Hello" --description "Greets the world" --script "C:\my\folder\hello.js" --startImmediately
Service installed.
Service started.

Uninstalling your service

Interactively

> qckwinsvc --uninstall
prompt: Service name: Hello
prompt: Node script path: C:\my\folder\hello.js
Service stopped.
Service uninstalled.

Non-interactively

> qckwinsvc --uninstall --name "Hello" --script "C:\my\folder\hello.js"
Service stopped.
Service uninstalled.

qckwinsvc's People

Contributors

kennyki avatar tallesl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qckwinsvc's Issues

Is there a way to set the current path?

My node script has a lot of relative paths. I'm assuming the service starts in the default service directory c:\windows\system32.

Is there way to have the node script default to working directory of the actual script?

Or did I just do something incorrectly?

Doesn't work after the Windows 1903 update

I had been using this successfully until I did the Windows 1903 update (the big one). After that the service wasn't there anymore and running the command to create it doesn't create it and doesn't output any result at all.

Express static routes are ignored

Express script with the following route config -

app.use('/', express.static('public'))

app.get('*', (req, res) => {
  res.sendFile(path.join(__dirname + '/public/index.html'))
})

works fine when executed with node command, but fails to recognize static files when running with windows service.

Running on Windows Server 2012.

Can't pass flags to script

I'm looking to autostart a node.js file that takes a few arguments on the command line. Can I use qckwinsvc to do this?

If I do this, it churns out an .exe and creates a service.
> qckwinsvc --name "name" --description "desc" --script "c:\path\to\node.js" --startImmediately

If I do this, I get the error below.
> qckwinsvc --name "name" --description "desc" --script "c:\path\to\node.js --web c:\path\to\web localhost:port1 localhost:port2" --startImmediately

fs.js:923
  return binding.mkdir(pathModule._makeLong(path), 

Error: ENOENT: no such file or directory, mkdir 'c:\path\to\node.js --web c:\daemon'
  at Error (native)
  at Object.fs.mkdirSync (fs.js:923:18)
  at c:\...\node-windows\lib\daemon.js:514:16
  at FSReqWrap.cb [as oncomplete] (fs.js.258.19)

log file size

is log files in the deamon folder has size limit?

How to pass parameters to script

Hi, I'm trying to set a parameter to my script but I can't do it.
I'm doing this:

qckwinsvc --name "WebAppServiceTwo" --description "WebAppServiceTwo" --script "C:\WebApps\webapp\app.js --port=1339" --startImmediatly

It doesn't work. Why?

Service name list

How to know the name of the service If i forget it accidentally ?

Service wont start

I get the following error in the log file:

C:\wg\node_modules\qckwinsvc\node_modules\node-windows\lib\wrapper.js:177
child.send('shutdown');
^

TypeError: Cannot read properties of null (reading 'send')
at process.killkid (C:\wg\node_modules\qckwinsvc\node_modules\node-windows\lib\wrapper.js:177:11)
at process.emit (node:events:390:28)
at process.exit (node:internal/process/per_thread:184:15)
at monitor (C:\wg\node_modules\qckwinsvc\node_modules\node-windows\lib\wrapper.js:99:17)
at ChildProcess. (C:\wg\node_modules\qckwinsvc\node_modules\node-windows\lib\wrapper.js:170:5)
at ChildProcess.emit (node:events:390:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
C:\wg\node_modules\qckwinsvc\node_modules\node-windows\lib\wrapper.js:177
child.send('shutdown');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.