JSNotebook
extends Nodebook
"JSNotebook" is used for .js
(JavaScript) files.
Usage
Setup
const Nodebook = require('nodejs-notebook');
const status = new Nodebook.JSNotebook('status');
note(value)
Similar to addLine(value)
but it does not automatically indent to the new line.
stringvalue
:
The value to code in.
status.note('console.log(\'Hello World\'');
// Writes down 'console.log('Hello World');
run()
Runs the JS file using node <file>
.
status.run()
// Logs 'Hello World'
comment(value)
Inserts a comment.
string value
:
The value to comment.
let latency = Date.now() - timestamp;
status.comment(`Runtime: ${latency}`);
// Comments 'Runtime: <latency>'
Last updated
Was this helpful?