graph BT
subgraph core[ ]
direction BT
subgraph rt[ ]
%% direction TB
cfw[Cloudflare Workers\nRuntime]
bun[Bun\nRuntime]
node[Node.js\nRuntime]
deno[Deno\nRuntime]| package main | |
| import ( | |
| "github.com/kardianos/service" | |
| "log" | |
| "flag" | |
| ) | |
| type Service struct {} |
| package main | |
| import ( | |
| "log" | |
| "syscall" | |
| "unsafe" | |
| "golang.org/x/sys/windows" | |
| ) |
| <html> | |
| <head> | |
| <title>Shell Example</title> | |
| <style> | |
| .answer { | |
| padding: 12px 0; | |
| font-weight: bold; | |
| } | |
| .command { |
| CREATE FUNCTION "nanoid"("size" int4 DEFAULT 21) | |
| RETURNS text | |
| LANGUAGE plpgsql | |
| STABLE | |
| AS | |
| $$ | |
| DECLARE | |
| id text := ''; | |
| i int := 0; | |
| urlAlphabet char(64) := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789'; |
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) |
(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 langua
Github gists don't support folders, so the code uses hyphens to dilineate where a directory should be. The directory structure should loook something like:
- root
- lib
app.js
- templates
header.htmlfooter.html
- lib
index.html
| { | |
| "classes": { | |
| "Test": { | |
| "line": 11, | |
| "description": "This is a test class. No extension.", | |
| "tags": {}, | |
| "exceptions": [], | |
| "events": {}, | |
| "extends": "john", | |
| "methods": { |
| <html> | |
| <body> | |
| Test | |
| <script src="./init/core.js"></script> | |
| <script src="./shared/core.js"></script> | |
| <script src="./ngn.js"></script> | |
| <script src="./eventemitter.js"></script> | |
| <script src="./bus.js"></script> | |
| <script src="./shared/exception.js"></script> | |
| <script src="./init/exception.js"></script> |