-
How to inject command into a service or processor or scheduler to run command from there? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Why would you need to run a CLI command from the processor/scheduler instead of using the service directly? |
Beta Was this translation helpful? Give feedback.
-
So to not write duplicate code, I'd like to run the command from a scheduler in a cron while my nest application is running, and I want to be able to run the commands manually when I need |
Beta Was this translation helpful? Give feedback.
-
Okay, that works. I just thought maybe there would be a way to |
Beta Was this translation helpful? Give feedback.
Well, to run a command from within a node application you use the
child_process
package from Node andspawn
orexec
a new shell to run the command.