简体   繁体   中英

Executing shell commands with javascript

I know it's not possible to execute shell commands on the clients browser via js.But I was wondering if it's possible if in the client side is not a browser instead an application that just fetchs webpages? thanks for your time guys!

The best would be to use a nodejs app

Node can be used to run javascript for everything in your computer, so, answering your question, you could, say, make an aplication that fetches webpages and run selected commands in the code that would be rejected by the browser.

But, if actually your goal is to just use javascript like a general use interpreted language (like say, python), you can just use js with node normally (ie, make your foo.js file and run from command line node ./foo.js

You can also use it as a server for web applications

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM