Saturday 2 December 2017

Node.js, PHP, Javascript Confusion





I am totally lost of what Node.js is all about so here's my
question:



Is node.js a new
language which can replace PHP or it is a language which can/only compliment/supplement
PHP and other web languages to perform complex task?



Answer




Node.js is server side Javascript environment
based on chrome V8 javascript engine.
It enables you to write your server code
in javascript, instead of choosing one of the "traditional" web languages such as PHP,
c#, python, ruby, perl etc. Using node.js and database such as mongodb you could write
your web application completely in
javascript.



Here's example of the full stack for
web
development:





  • href="http://backbonejs.org/" rel="noreferrer">Backbone for client side,
    code that runs in the browser (chrome,firefox)

  • href="http://expressjs.com/" rel="noreferrer">Express server side framework
    running on Node.js

  • rel="noreferrer">Mongodb database for storing documents



Above mentioned
technologies will enable you create your application writing only javascript code, from
browser to server and finally to database, sort of one language to rule them :), no need
for PHP unless you have legacy codebase .



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...