Skip to content

Instantly share code, notes, and snippets.

@coreybutler
Last active May 23, 2021 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreybutler/e893d7d52ca6e50f1cc11c612b378648 to your computer and use it in GitHub Desktop.
Save coreybutler/e893d7d52ca6e50f1cc11c612b378648 to your computer and use it in GitHub Desktop.
What is the difference between JavaScript and Node.js?

(Original question at https://www.quora.com/What-is-the-difference-between-JavaScript-and-Node-js/)

There are some good prior answers, but they’re slightly outdated now.

JavaScript is a language, or more precisely, an implementation of ECMAScript. It is governed by a group known as TC39.

Node.js is a runtime. It’s written in C++. It was originally built on top of Chrome’s V8 JavaScript engine. Today, Node supports something known as N-API. This allows it to run atop other JavaScript engines (Microsoft’s Chakra is the first). However; the interesting parts of Node have always been the “add-on” stuff it provides, which is a library known as libuv.

Different runtimes implement different features. JavaScript is just the language used to expose such features to developers. For example, Node.js (via libuv) creates bindings to the file system, allowing developers to read and write from disk. The JS engines in browsers don’t support this, but they do support things like the Document Object Model (DOM).

The communities around each of these differ to. For example, Node projects are a part of the greater JavaScript community, but not all JavaScript projects are part of the Node community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment