search

Home  >  Q&A  >  body text

javascript - How to call node command line command in js

Can I call the node command line or scripts in npm in a js file? If so, how should I do it?

世界只因有你世界只因有你2762 days ago1026

reply all(2)I'll reply

  • 为情所困

    为情所困2017-06-19 09:09:55

    It depends on the environment you are in. If you are in a browser environment, errors may occur when executing these statements. If you are in a Node server environment, you may be able to directly use the API provided by Node instead of executing these statements through the command line yourself.

    If you have to do this: http://www.cnblogs.com/chying...
    You can refer to this tutorial

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-19 09:09:55

    Use the exec method of chilld_process of node.js
    Refer to https://nodejs.org/dist/lates...

    reply
    0
  • Cancelreply