Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: Testing 18.04
Path: javascript.ipynb
Views: 666Kernel: Javascript (Node.js)
JavaScript in CoCalc
In [1]:
2
In [2]:
'v10.19.0'
In [3]:
In [4]:
[ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ]
Testing Async
Make sure to read http://n-riesco.github.io/ijavascript/doc/async.ipynb.html !!!
In [5]:
In [6]:
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1+1"
]
}
In [7]:
In [8]:
start
done
Little HTTP Server
Open it up at https://cocalc.com/[YOUR PROJECT ID]/server/8080
more info: https://doc.cocalc.com/howto/webserver.html
In [9]:
Server {
insecureHTTPParser: undefined,
_events:
[Object: null prototype] {
request: [Function],
connection: [Function: connectionListener] },
_eventsCount: 2,
_maxListeners: undefined,
_connections: 0,
_handle:
TCP {
reading: false,
onread: null,
onconnection: [Function: onconnection],
[Symbol(owner)]: [Circular] },
_usingWorkers: false,
_workers: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
keepAliveTimeout: 5000,
maxHeadersCount: null,
headersTimeout: 40000,
_connectionKey: '6::::8080',
[Symbol(IncomingMessage)]:
{ [Function: IncomingMessage]
super_:
{ [Function: Readable]
ReadableState: [Function: ReadableState],
super_: [Function],
_fromList: [Function: fromList],
from: [Function] } },
[Symbol(ServerResponse)]:
{ [Function: ServerResponse] super_: { [Function: OutgoingMessage] super_: [Function] } },
[Symbol(asyncId)]: 63 }
The code above then works like that:
In [0]: