Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodebook

The data science notebook nobody asked for.

The Nodebook interface

"I wonder what a Jupyter notebook would look like for JavaScript, with Pandas and Statsmodels functionality," said nobody ever. But I made it anyway.

Nodebook is a Jupyter-like notebook environment for Node.js: interactive data wrangling and analysis in the browser, powered by a real Node kernel and friends like @dominicdayta/nodestat. It does not currently solve a burning industry need. It does let you run cells, save outputs, and stare at DataFrame tables like a respectable analyst.

Open a browser, browse your project files, edit .ijsnb notebooks, run Node code cell by cell, and see results - including proper DataFrame tables when you print nodestat-style frames.

It is intentionally smaller than JupyterLab: a local web app with an isolated Node child-process kernel, persisted outputs for reproducibility, and a focused UI.

Features

  • Node.js kernel: detects and runs the Node runtime on your machine in an isolated child process per notebook
  • File browser: navigate folders; create, rename, and delete directories and .ijsnb notebooks
  • Markdown cells: edit and render Markdown with KaTeX math ($...$ / $$...$$)
  • Code cells: JavaScript with require(), top-level await, and workspace fs access
  • Persisted outputs: like Jupyter, cell outputs are stored in the notebook file so reopening shows results without re-running
  • Run controls: Run Cell, Run All, Run All Above, Run All Below; Clear Outputs (cell or notebook)
  • DataFrame tables: when a cell returns (or console.logs) a nodestat-style DataFrame, Nodebook renders a proper HTML table (column names, row indices). This is a Nodebook UI feature. It does not modify nodestat.

Quick start

cd nodebook
npm install
npm run build
npm start

Open http://127.0.0.1:8787

For development with hot-reload UI:

npm run dev:server   # terminal 1 - API on :8787
npm run dev:client   # terminal 2 - Vite on :5173 (proxies /api)

Or build once and run the server (serves client/dist):

npm run dev

By default the workspace root is ./workspace (created on first launch). Override with:

set NODEBOOK_ROOT=C:\path\to\your\project
npm run dev

(On Unix: NODEBOOK_ROOT=/path/to/project npm run dev.)

Using nodestat

Install nodestat in your workspace (the folder Nodebook uses as NODEBOOK_ROOT):

cd your-workspace
npm install @dominicdayta/nodestat

In a code cell:

const nstat = require('@dominicdayta/nodestat');
const women = nstat.stat.dataset('women');
women

The last expression is displayed. DataFrames appear as tables in the output area and are saved with the notebook.

Note: The nodestat package is a separate project. Nodebook only consumes it via require - it does not patch or vendor nodestat.

Example notebooks

Regenerate saved outputs after serializer changes:

node scripts/generate-examples.js

Scripts

Command Description
npm run dev Start the Nodebook server (API + static client if built)
npm run dev:client Vite dev server for the React UI
npm test Run unit tests (shared + server)
npm run build Build the client for production
npm start Run the server (serves built client from client/dist)

Documentation

Architecture (short)

Browser (React)  →  Express API / WebSocket  →  Workspace FS
                                         ↘  Node child-process kernel

Notebooks are JSON (.ijsnb). The kernel speaks a simple JSON-lines protocol; rich outputs use MIME bundles such as application/vnd.nodebook.dataframe+json.

License

MIT

About

The data science notebook nobody asked for.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages