An interactive JavaScript and TypeScript notebook for writing and executing code directly in your browser. Similar to Jupyter Notebook but specifically designed for JavaScript/TypeScript development.
- Live Code Execution: Write and execute JavaScript/TypeScript code in real-time
- Monaco Editor: Full-featured code editor with IntelliSense, syntax highlighting, and auto-completion (same editor as VS Code)
- Multiple Cell Types: Support for both code cells and markdown documentation cells
- NPM Package Support: Import and use any NPM package directly in the browser via unpkg.com
- ESBuild Integration: Fast in-browser bundling and transpilation with WebAssembly
- Interactive Output: See console output and returned values immediately
- Cell Management: Add, delete, move, and reorder cells easily
- Auto-formatting: Built-in Prettier support for consistent code formatting
- Cumulative Code Execution: Later cells can reference variables and functions from earlier cells
- JSX Support: Write and render React components directly
- Security: Safe execution of user code in isolated iframes
# Install globally
npm install -g js-notebook-cli
# Create and edit a notebook
js-notebook serve mynotebook.js
# Open on a specific port
js-notebook serve mynotebook.js --port 3000# Clone the repository
git clone https://github.com/ymw0331/JS-Notebook.git
cd JS-Notebook
# Install dependencies
npm install
# Start development servers
npm start
# The app will open at http://localhost:4005Write JavaScript or TypeScript code and press Cmd/Ctrl + Enter to execute:
// Import any NPM package
import axios from 'axios';
// Make API calls
const response = await axios.get('https://api.github.com/users/ymw0331');
console.log(response.data);Create and render React components:
import React from 'react';
import ReactDOM from 'react-dom';
const App = () => {
const [count, setCount] = React.useState(0);
return (
<div>
<h1>Counter: {count}</h1>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
);
};
ReactDOM.render(<App />, document.getElementById('root'));Document your code with rich markdown formatting. Click to edit, click outside to preview.
JS-Notebook/
├── packages/
│ ├── local-client/ # React frontend application
│ │ ├── src/
│ │ │ ├── components/ # UI components
│ │ │ ├── state/ # Redux store and reducers
│ │ │ ├── bundler/ # ESBuild integration
│ │ │ └── hooks/ # Custom React hooks
│ │ └── public/
│ ├── local-api/ # Express backend API
│ │ └── src/
│ │ ├── routes/ # API endpoints
│ │ └── index.ts # Server configuration
│ └── cli/ # Command-line interface
│ └── src/
│ └── commands/ # CLI commands
├── lerna.json # Monorepo configuration
└── package.json # Root package configuration
- Frontend: React 18, TypeScript 5, Redux Toolkit
- Editor: Monaco Editor (VS Code's editor)
- Bundler: ESBuild WebAssembly
- Styling: Bulmaswatch (Bulma CSS themes)
- Build Tool: Create React App with CRACO
- Backend: Express 5, http-proxy-middleware
- Monorepo: Lerna workspace management
- Testing: Jest, React Testing Library
# Run all packages in development mode
npm start
# Build all packages
lerna run build
# Run tests
npm test
# Build for production
npm run buildSee VERCEL_DEPLOYMENT_GUIDE.md for detailed deployment instructions.
- Push to GitHub
- Import repository on Vercel
- Set root directory to
packages/local-client - Deploy!
- Cloud storage integration (AWS S3, Google Drive)
- Collaborative editing with WebRTC
- Export to various formats (HTML, PDF, Markdown, .ipynb)
- Custom themes and color schemes
- Plugin system for extensions
- Git integration for version control
- Unit testing support within cells
- Data visualization libraries integration
- Terminal/console cell type
- AI code completion
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT
Wayne Yong - GitHub
- Inspired by Jupyter Notebook
- Built with Monaco Editor from Microsoft
- Uses ESBuild for ultra-fast bundling
- Based on concepts from Stephen Grider's React and TypeScript course