smith hab nix
smith hab nix

Reputation: 3

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!

Upvotes: 0

Views: 164

Answers (1)

Faccion
Faccion

Reputation: 274

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

Upvotes: 1

Related Questions