> For the complete documentation index, see [llms.txt](https://nodebook.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodebook.js.org/js/javascript.md).

# JSNotebook

"JSNotebook" is used for `.js` (JavaScript) files.

## Usage

### Setup

```javascript
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.

string`value`:\
The value to code in.

```javascript
status.note('console.log(\'Hello World\'');
// Writes down 'console.log('Hello World');
```

**run()**

Runs the JS file using `node <file>`.

```javascript
status.run()

// Logs 'Hello World'
```

**comment(value)**

Inserts a comment.

string `value`:\
The value to comment.

```javascript
let latency = Date.now() - timestamp;

status.comment(`Runtime: ${latency}`);
// Comments 'Runtime: <latency>'
```
