Nodebook
  • Introduction
  • Methods
  • Default Classes
    • Nodebook
  • JS
    • JSONotebook
    • JSNotebook
    • TSNotebook
  • Java
    • JavaNotebook
  • C/C++
    • CPPNotebook
    • CNotebook
    • HeaderNotebook
  • Text
    • TXTNotebook
    • MDNotebook
    • PlainNotebook
  • Web
    • HTMLNotebook
    • CSSNotebook
      • CSSStyle
  • Other
    • YMLNotebook
    • BashNotebook
  • Python
    • PYNotebook
Powered by GitBook
On this page
  • Usage
  • Setup

Was this helpful?

  1. JS

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>'
PreviousJSONotebookNextTSNotebook

Last updated 4 years ago

Was this helpful?