Can node.js be used as the basis for running arbitrary server-side Javascript in web applications?

Can node.js be used as a general framework for running server-side Javascript, especially for web applications that are completely unconnected with non-blocking and asynchronous I / O? In particular, I want to know if I can run arbitrary Javascript on a (web server) without using other node.js functionality.

+3
source share
4 answers

Yes. There are many web frameworks built on node. The most famous Express based Connect ,

Connect Ruby Rack node

:

node.js

I/O - -, , - node .

+3

, node.js , :

$ cat hello.js
console.log('Hello world!');
$ node hello.js
Hello world!

, .

+5

, "node.js" v8, , , Javascript. - , , . , node.js.

+1

. , Node / (, TCP ..), JavaScript Chrome V8.

Node :

  • Run famous javascript file

    $ Node some_script.js

  • Performed in REPL (interactive mode)

    $ node

    var i = 1;
    console.log (i);
    1

0
source

Source: https://habr.com/ru/post/1784577/


All Articles