windows-downtime-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +21 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFile } = require('child_process');
4
+ const path = require('path');
5
+
6
+ // Get full path to the EXE (note the space in the file name)
7
+ const exePath = path.join(__dirname, 'Windows Downtime.exe');
8
+
9
+ // Pass all command-line arguments from user to the EXE
10
+ execFile(exePath, process.argv.slice(2), (error, stdout, stderr) => {
11
+ if (error) {
12
+ console.error(`Error: ${error.message}`);
13
+ return;
14
+ }
15
+ if (stderr) {
16
+ console.error(`stderr: ${stderr}`);
17
+ }
18
+ if (stdout) {
19
+ console.log(stdout);
20
+ }
21
+ });
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "windows-downtime-cli",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "bin": {
6
+ "downtime": "./index.js"
7
+ },
8
+ "scripts": {},
9
+ "author": "Your Name",
10
+ "license": "MIT"
11
+ }