Metadata-Version: 2.4
Name: livejs
Version: 0.1.0
Summary: 
Author: Casey Duckering
License-Expression: MIT
License-File: LICENSE.txt
Requires-Dist: ipykernel~=7.0
Requires-Python: >=3.10
Project-URL: homepage, https://tangled.org/cduck.me/livejs/
Project-URL: source, https://tangled.org/cduck.me/livejs/
Description-Content-Type: text/markdown

# LiveJS

A [Jupyter](https://jupyter.org/) kernel for JavaScript that executes code directly in your web app.

[![Screenshot of Jupyter and a demo web page side-by-side showing the result of running the Demo.ipynb jupyter notebook](https://mirror.tangled.network/xrpc/sh.tangled.git.temp.getBlob?path=example%2Fdemo-screenshot.png&ref=main&repo=did%3Aplc%3Au55txonvn6d6sjsqr2r27ogo)](https://tangled.org/cduck.me/livejs/tree/main/example)

- Use this kernel for quick interactive feedback by running snippets of JavaScript within your web app and viewing the results from Jupyter.
- Written from scratch with the kernel hosted from Python.
- No JavaScript dependencies.  No NodeJS.

Note: This project is in very early development and may not have a smooth user experience.

## Install

- Install the [uv Python package manager](https://docs.astral.sh/uv/getting-started/installation/)
    ```bash
    $ curl -LsSf https://astral.sh/uv/install.sh | sh
    ```
- Install [Jupyter](https://jupyter.org/install)
    ```bash
    $ uv tool install jupyterlab
    $ uv tool install jupyter-core
    ```
- Install [LiveJS](https://tangled.org/cduck.me/livejs/)
    ```bash
    $ uv tool install git+https://tangled.org/cduck.me/livejs
- Install the LiveJS kernel into Jupyter
    ```bash
    $ livejs-install --user
    OR
    $ livejs-install --sys-prefix
    ```

## Usage

- Launch Jupyter
    ```bash
    $ cd my/working/directory
    $ jupyter lab
- Within the Jupyter interface, create a new notebook and select the kernel "LiveJS"
- In the first cell, run `%serve "path/to/my/webroot", "localhost", 5000`
- In the other cells, run JavaScript!
- Advanced: For async Javascript, put the `%%async` magic at the top of each cell

## Demo

<video src="https://mirror.tangled.network/xrpc/sh.tangled.git.temp.getBlob?path=example%2Fdemo-video.mp4&ref=main&repo=did%3Aplc%3Au55txonvn6d6sjsqr2r27ogo" width="100%" controls alt="Video of Jupyter and a demo web page side-by-side showing the results of typing and running the Demo.ipynb jupyter notebook"></video>
