Skip to content

Commit c48143b

Browse files
committed
Add package to run JS with NodeJS
1 parent c0b4f94 commit c48143b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from lib.common.abstracts import Package
2+
3+
4+
class NodeJS(Package):
5+
"""Package for executing JavaScript files using NodeJS."""
6+
7+
PATHS = [
8+
("ProgramFiles", "NodeJS", "node.exe"),
9+
("LOCALAPPDATA", "Programs", "NodeJS", "node.exe"),
10+
]
11+
summary = "Executes a JS sample using NodeJS."
12+
description = "Uses node.exe instead of wscript.exe to execute JavaScript files."
13+
14+
def start(self, path):
15+
node_path = self.get_path("node.exe")
16+
return self.execute(node_path, f'"{path}"', path)

0 commit comments

Comments
 (0)