How to connect a nodejs library in php?

I use Nesk\Puphpeteer, I had to connect the module puppeteer-puppeteer and extra-extra-plugin-stealth, I have these installed as specified.
The location of this file Nesk\Puphpeteer is located in /var/www/html/vendor/ and the modules in /var/www/html/node_modules/
Now I need these modules to connect and use in your script, at the moment my script is as follows
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
use Nesk\Puphpeteer\Resources\ElementHandle;
$browser=$puppeteer->launch(['args'=>['--no-sandbox'],'headless' => true]);
$html_page->setUserAgent('Opera/9.80 (Windows NT 6.2; WOW64) Presto/2.12.388 Version/12.17');
$content=$html_page->evaluate(JsFunction::createWithBody('return document.documentElement.outerHTML'));
echo $content;

Now as there is in the instructions for those plugins listed
const puppeteer = require("puppeteer-extra")

you should connect them, only don't know how to do it in PHP in my code, tell me who knows how to do it.
March 25th 20 at 13:45
3 answers
March 25th 20 at 13:47
No way. Nesk\Puphpeteer does not broadcast commands in nogowski puppeteer using PuppeteerConnectionDelegate.js. Correct/replace it and be happy.
March 25th 20 at 13:49
In the instructions to the plugin code in JS, not a fact, you all will connect these plugins, because they are also written in JS. node_modules is the folder of the modules that puts npm (Nodejs Package manager) for PHP with them at all no not associated. that would be the plugins worked, they must have the implementation in PHP.

Maybe easier to write what you need in JS? It's not a hard language, it's much more convenient and easier to write bots using pupeteer.
Here's how it works for me, crowns in a certain time runs a php script, this script takes data from mysql , then runs the script and writes the results into the database how to do this in JS ? - Lorna.Kris commented on March 25th 20 at 13:52
@Lorna.Kris, Yes, exactly the same, only JS. C MySQL it can work, reversed to run as a node /path/to/app.js can. - andres.Gleason32 commented on March 25th 20 at 13:55
@andres.Gleason32, but how would the entire script execution actions are already written in PHP, has only been sharpened by PhantomJS merlinthemagic to adapt Puphpeteer is to replace some strings (clicks, insert in the field), and so fully that all need to be rewritten, Yes plus to study the interaction between mysql and js, in General the difference is very big.... - Lorna.Kris commented on March 25th 20 at 13:58
@Lorna.Kris, googling about Nats, RabbitMQ, Apache Kafka
Can help - brandy.Rempel78 commented on March 25th 20 at 14:01
March 25th 20 at 13:51
Call from php rogovskoy command via exec(), and it has a js action puppeter

Find more questions by tags Node.jsPHP