Giter VIP home page Giter VIP logo

tslab's Introduction

tslab

CI Binder npm version

tslab is an interactive programming environment and REPL with Jupyter for JavaScript and TypeScript users. You can write and execute JavaScript and TypeScript interactively on browsers and save results as Jupyter notebooks.

Features

  • Interactive JavaScript and TypeScript programming with Jupyter and Node.js.
  • The power of types from TypeScript project.
    • Type safety even in JavaScript mode.
    • Rich code completion and code inspection thanks to types.
  • Display non-text contents like images, HTML, JavaScript, SVG, etc...
  • Interactive deep neural network machine learning (TensorFlow.js) and data exploration with JavaScript.
  • JavaScript is 40x faster than Python.
  • TypeScript 5.0 support.
  • Top-level await support.
  • REPL console support.

Screenshots: Code inspection (Shift-Tab) and completion (Tab)

Try tslab without installing it

Binder

Thanks to binder (mybinder.org), you can try tslab on your browsers without installing it into your system. Open a temporary Jupyter Notebook from the button above and enjoy interactive JavaScript and TypeScript programming.

Example notebooks

To learn what what we can do with JavaScript on Jupyter, view example notebooks in nbviewer.

If nbviewer is down, please view the notebooks on GitHub instead.

Installing tslab

Prerequisites

Installing tslab

First, install tslab with npm.

npm install -g tslab

Please make sure tslab command is available in your terminal.

tslab install --version

Then, register tslab to your Jupyter environment.

tslab install [--python=python3]

By default, tslab is registered with python3 in unix-like system and python in Windows. If Jupyter is installed with a different Python in your system, please specify the python command with --python flag.

After you run tslab install, please check two kernels (jslab and tslab) are installed properly to jupyter.

$ jupyter kernelspec list
Available kernels:
  jslab      /usr/local/google/home/yunabe/.local/share/jupyter/kernels/jslab
  tslab      /usr/local/google/home/yunabe/.local/share/jupyter/kernels/tslab

Usage: JupyterLab and Jupyter Notebook

After you register tslab to Jupyter, start JupyterLab and Jupyter Notebook as usual. You can now create JavaScript and TypeScript notebooks.

# JupyterLab
# `--port=` to change the port to accept connections.
# `--ip=0.0.0.0` to accept external connections.
jupyter lab [--port=8888] [--ip=0.0.0.0]

# Jupyter Notebook
jupyter notebook

In Jupyter, you can complete code by pressing Tab and show tooltips by pressing Shift + Tab.

Usage: REPL console

You can also use tslab and Jupyter as an interactive console (REPL). To use tslab as REPL, please run jupyter console with --kernel=jslab (JavaScript) or --kernel=tslab (TypeScript).

jupyter console --kernel=tslab

Clarification

tslab is an interactive JavaScript and TypeScript programming environment on Node.js (aka Server-side JavaScript). tslab does not support code execution on browsers (aka Client-side JavaScript) at this moment.

Read more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.