]> _ Git - cubist_util.git/commitdiff
wip #5661 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 Jan 2023 18:26:55 +0000 (19:26 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 Jan 2023 18:26:55 +0000 (19:26 +0100)
src/CommandLine/Node.php [new file with mode: 0644]

diff --git a/src/CommandLine/Node.php b/src/CommandLine/Node.php
new file mode 100644 (file)
index 0000000..d5b16b9
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace Cubist\Util\CommandLine;
+
+use Cubist\Util\CommandLine;
+use Cubist\Util\Files\Files;
+
+class Node
+{
+    public static function runJS($code)
+    {
+        $tmp = Files::tempnam() . '.js';
+        file_put_contents($tmp, $code);
+
+        $cl = new CommandLine('node');
+        $cl->setArg(null, $tmp);
+        $cl->execute();
+        return $cl;
+    }
+
+
+}
\ No newline at end of file