1.8.1 • Published 2 years ago

winsw-wrapper v1.8.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

npm i winsw-wrapper
# or
yarn add winsw-wrapper

Example

import path from "path";
import WinswWrapper, { WinswWrapperOptions } from "winsw-wrapper";

let test = new WinswWrapper({
  id: "test id",
  name: "test name",
  description: "test description",
  executable: "electron.exe",
} as WinswWrapperOptions);

test
  // .setWrapperBinPath(path.join(__dirname, '../../bin'))
  .setServiceAccount({
    allowservicelogon: false,
  })
  .afterFailure("reload", "10 sec")
  .resetFailure("1 hour")
  //   .arguments(__dirname)
  .arguments(path.join(__dirname, "../index.js"))
  .arguments("--start")
  .arguments("--AsService")
  // .arguments("--start --AsService")
  // .startarguments("--start --AsService")
  .workdir(path.join(__dirname, "../"))
  .priority("High")
  .stoptimeout("15 sec")
  .stopparenfirst(true)
  .stopexecutable("electron.exe")
  .stoparguments("--stop")
  .startmode("Automatic")
  .delayedAutoStart(true)
  .env("test", "test")
  .env("test1", "test1;test2")
  .depend("Eventlog")
  .depend("W32Time")
  .logpath(path.join(__dirname, "../log"))
  // .logmode('append')
  .logmode("roll-by-size", {
    sizeThreshold: 10240,
    keepFiles: 8,
  })
  .on("error", (err) => {
    console.log(err);
  })
  .on("install", (result) => {
    console.log(result);
    if (result.state === "success") {
      test.uninstall();
    } else if (result.state === "error" && result.data == "Existent") {
      test.uninstall();
    }
  })
  .on("uninstall", (result) => {
    console.log(result);
  })
  .install();

Related

winsw Used winsw-v2.11.0

License

winsw-wrapper is licensed under the MIT license.

1.8.1

2 years ago

1.8.0

2 years ago

1.7.9

2 years ago

1.7.8

2 years ago

1.7.7

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.4

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.9

2 years ago

1.6.8

2 years ago

1.6.7

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago