Run NPX script programatically

27 Views Asked by At

Like the title says, is there any way to call an npx script through an npm library on nodejs? Due to security concerns, the platform we are using does not allow the creation of child processes so thats why I am asking.

EDIT: Ok, to add more context. The platform we use allows to define api calls that call a method defined in a certain language with certain libraries. For example, I can define an API call that requires a Method implemented in NodeJS. I can define the route of the api call, the method in nodejs and even the runtime. I cannot, however, call another child process from that nodejs runtime. I understand Npm can be called programatially using the NPM module from NodeJS, so I was wondering if it was possible to do the same with NPX. I specifically want to call the NPX playwright scripts that allow you to install browsers and their dependencies.

0

There are 0 best solutions below