JSPM

  • Created
  • Published
  • Downloads 25529
  • Score
    100M100P100Q138573F
  • License BSD-3-Clause

Jupyter for JavaScript and TypeScript

Package Exports

  • tslab

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslab) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tslab

Build Status Binder npm version

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 machine learning programming (TensorFlow.js) and data exploration with JavaScript.
  • JavaScript is 40x faster than Python.
  • TypeScript 3.7 support.
  • Top-level await 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

Installing tslab

Prerequisites

Installing tslab by npm

npm install -g tslab

Please make sure tslab command is available in your terminal.

tslab install --version

Registering tslab to Jupyter

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.

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
jupyter lab [--port=8888]

# Jupyter Notebook
jupyter notebook [--port=8888]

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