npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@snomiao/tslab

v1.0.21

Published

Jupyter for JavaScript and TypeScript

Downloads

3

Readme

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