
Node.js: Install .js project as a Service | Windows Tutorial
Want a Node script to run 24/7 in the background of your computer, without needing to remember to start it? Don't want any visible signs that it's running? Well, you can set up your project to run as a Windows Service in the background, with the automatic starting ability, as well as other perks of having it run as a Windows Service.
Code:
---------------
var Service = require('node-windows').Service;
var svc = new Service({
name:'Service name',
description: 'Node.js service description goes here.',
script: 'C:\\path\\test.js'
});
svc.on('install',function(){
svc.start();
});
svc.install();
---------------
Timestamps:
0:00 - Explanation
0:20 - Installing node-windows
0:33 - Creating service script for a node project
1:26 - Installing node project as Windows service
2:50 - Uninstall node service on Windows
#Node #Service #Install
-----------------------------
๐ธ Found this useful? Help me make more! Support me by becoming a member: https://youtube.com/channel/UCkih2oVTbXPEpVwE-U7kmHw/join
-----------------------------
๐ธ Direct donations via Ko-Fi: https://ko-fi.com/TCNOco
๐ฌ Discuss video & Suggest (Discord): https://s.tcno.co/Discord
๐ Game guides & Simple tips: https://YouTube.com/TroubleChuteBasics
๐ Website: https://tcno.co
๐ง Need voice overs done? Business query? Contact my business email: TroubleChute (at) tcno.co
Everything in this video is my personal opinion and experience, and should not be considered professional advice. Always do your own research and make sure what you're doing is safe.