GithubHelp home page GithubHelp logo

yunabe / tslab Goto Github PK

View Code? Open in Web Editor NEW
643.0 8.0 42.0 476 KB

Interactive JavaScript and TypeScript programming with Jupyter

License: Apache License 2.0

JavaScript 0.07% Python 1.12% TypeScript 98.81%
jupyter jupyter-notebook jupyterlab typescript javascript repl nodejs

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

tslab's People

Contributors

tiagosiebler avatar yannisgu avatar yunabe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tslab's Issues

Stop waiting for the last Promise automatically

In the current implementation, when we run the code below, tslab wait for the asynchronous result of hello() and shows Hello, tslab!.

function hello(): Promise<string> {
    return new Promise(done => {
        setTimeout(() => {
            done('Hello, tslab!');
        }, 100);
    });
}

hello();

After I created some notebooks (e.g. MNIST with tenworflow.js), I noticed this behavior is a little confusing because hello() shows Hello, tslab!, not Promise(...) and users misunderstand hello() returns string, not Promise<string>.

Also, Chrome dev console, which supports top-level await, shows Promise {<pending>} for hello(). Chrome dev console shows Hello, tslab! when await hello() is executed.

Thus, I think we should stop waiting for the last Promise automatically. We should support top-level awaits instead (#16).

code completion on any fails with "Cannot read property 'entries' of undefined"

How to reproduce this issue

let x: any;
x.a

Then, then complete code after x.a. It fails with a message like:

(node:69973) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'entries' of undefined
    at completionWithId (/Users/yunabe/src/tslab/dist/converter.js:229:33)
    at Object.complete (/Users/yunabe/src/tslab/dist/converter.js:202:20)
    at Object.complete (/Users/yunabe/src/tslab/dist/executor.js:113:21)

matchAll function is not found for a string.

'bar bar sheep'.matchAll(/(bar)/g)

The above will give error:
1:17 - Property 'matchAll' does not exist on type '"bar bar sheep"'.

In Node, it gives expected output:

> 'bar bar sheep'.matchAll(/(bar)/g)
Object [RegExp String Iterator] {}

Disable ANSI colorization in output by default?

If I run console.log(55), the Jupyter message I get back is a stdout stream with the contents "\u001b[33m55\u001b[39m\n" because of the ANSI escapes for colorization. I was hoping to get "55\n" just like I would if I did print(55) in a Python kernel.

Cannot find module when launched from another drive under Windows

C:\>ver

Microsoft Windows [Version 10.0.18363.752]

C:\>jupyter console --kernel=jslab
unknown msg_type: history_request
Jupyter console 6.1.0

JavaScript
In [1]: const fs = require("fs")

In [2]:
Do you really want to exit ([y]/n)? y
Shutting down kernel

C:\>d:

D:\>jupyter console --kernel=jslab
unknown msg_type: history_request
Jupyter console 6.1.0

JavaScript
In [1]: const fs = require("fs")
1:20 - Cannot find module 'fs'.

In [2]:
Do you really want to exit ([y]/n)? y
Shutting down kernel

D:\>

const fs = require("fs") failed with Cannot find module 'fs' when jupyter is launched from somewhere under another drive other than C:.

jupyter kernelspec list does not show the tslab kernel

Is anything that's broken in this solution, I installed it but I do not see the kernel running. Anything special that I should do to get it running? There is no error, or issue that I see. How do I investigate it?

tslab crashes with "Unhandled 'error' event"

Problem

If we run

import http from "http";
http.get('http://localhost:12345');

the kernel crashes with a message like:

      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:12345
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (_http_client.js:406:9)
    at Socket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 12345
}

Solution

Help - Looking for ideas to implement a vault

Hi, Can you please let me know if you have ideas to implement a secure store?

  1. Setup a vault and add secrets
  2. From Jupyter UI, tell the kernel to pick the secret possibly replace in a placeholder
    for example if cell has
    const header = { auth: bearer $${get_secret("xyz")} }
  3. Kernel preprocesses code extracts $${get_secret("xyz")}, securely retries it from the vault and replaces the secret in the code and continue execution of the code

Thanks for your insights! Great kernel by the way.

Cannot find module 'tslab'.

I followed the instructions to get tslab on my computer; I get 1:24 - Cannot find module 'tslab'.

I am using windows.

$ jupyter --version

jupyter core     : 4.6.1
jupyter-notebook : 6.0.2
qtconsole        : not installed
ipython          : 7.9.0
ipykernel        : 5.1.3
jupyter client   : 5.3.4
jupyter lab      : 1.2.3
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.3

$tslab install
Running python <<user>>\AppData\Roaming\npm\node_modules\tslab\python\install.py --tslab=tslab.cmd
Installing TypeScript kernel spec
Installing JavaScript kernel spec
$tslab --version
tslab 1.0.4

Can you please help?

Help - How to use widgets

I am wondering how to use HTML widgets for user input that uses @jupyter-widgets/base and tslab kernel.

Thanks in advance!

tslab cannot find globally-installed modules even when NODE_PATH is set

Hi & thanks for your work putting tslab together!

(I believe this is separate from #40, which is talking about the built-in fs module that works fine for me).

I'm trying to use tslab in a containerised environment with some globally-installed packages e.g.:

RUN npm install -g \
    @tensorflow/[email protected] \
    @tensorflow/[email protected] \
    @tensorflow/[email protected] \

The packages get installed in the /usr/lib/node_modules folder.

I understand that NodeJS require can't find globally-installed packages by default, but setting the NODE_PATH environment variable can fix it. However, not with tslab it seems...

Is there some other way to enable this?

Expected behavior:

tslab/jslab kernels should be able to see global packages - either always as a design decision, or else iff the NODE_PATH environment variable is set.

Observed behavior:

Setting the environment variable in my container, I can see:

  • process.env.NODE_PATH is set, inside the jslab kernel, and
  • Standard node in a terminal can require the packages correctly if referenced in a script file, but
  • I cannot e.g. require("@tensorflow/tfjs") in the kernel - getting error like Cannot find module '@tensorflow/tfjs' or its corresponding type declarations.

Setup:

  • tslab version: 1.0.15
  • Kernel: JavaScript (jslab)
  • Platform: Linux (Ubuntu 18.04)

Design API to access tslab utilities from other libraties

From notebooks, users can use "tslab" module to access tslab utilities.

import * as tslab from "tslab";
tslab.display.jpeg(img);

But this does not work well when other libraries want to use tslab library because

  1. Libraries do not want to depend on tslab because they are not always used under tslab.
  2. If the version of tslab main routine and the version of tslab which other libraries depend on are different, two+ tslab modules are installed separately and non-main tslab library does not work properly.

Thus, we need to design a proper API for other libraries so that they can implement special handlings when they are used under tslab.

Can not resolve JSON module

I am using tslab for data analysis, and I am trying to import a .json file to a notebook. However, it's throwing the error:

2:23 - Cannot find module '******.json'. Consider using '--resolveJsonModule' to import module with '.json' extension

This issue seems like a variation of this one: #25, however you fixed this issue by enabling this flag in the global config. Is it possible to set this manually, or would you be able to do the same and set this flag globally? To me, it makes sense to allow .json file resolution by default in a notebook.

Thank you!

Missing built-in Javascript objects

Hello,

this code works on Binder but not in my local Jupyter Lab (under Windows 10) with a TypeScript kernel:

let person = new Object();

I receive this error:

Cannot find name 'Object'.

Other objects like the functions parseInt, parseFloat etc. are also not available. Did you configure something to have this available in Binder? If so, maybe you could consider documenting it 😊 ? Thanks in advance!

Documentation shortcut doesn't work

Autocomplete works, but I wish I could see documentation of a function with Shift+Tab. Is this something that can be configured, or is it simply not implemented yet?

Can not find module

Hi there,

When try below code in the jupyter lab after installing the tslab, result message is 'Cannot find module 'fs' or its corresponding type declarations'

const fs = require("fs");

Next is no problem.
const tslab = require("tslab");

What do I need to check?

Thanks.

Cannot Import Module 'Ramda'

Hi!

Love the package. Thanks.

I would like to add external packages such as ramda, however I get the following error message:

1:20 Cannot find module 'ramda' or its corresponding type declarations.

How can I make this work?
Thanks!

image

Pass unit tests on Windows

yarn test

does not pass on Windows now for some reason. We did not notice a critical bug like #26 because we don't test tslab on Windows regularly.

How to set configuration?

I am making use of
import * as mongoose from 'mongoose';

class Vehicle {
    @prop({ unique: true })
    vid?: string;
}

This causes the error...
3:5 - Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

I created a tsconfig.json file in the notebook directory with { ... "compilerOptions": { "experimentalDecorators": true, ... } } but I see no difference.
I suspect I have put the tsconfig.json in the wrong place?

Error upon executing anything

Hello, I've just freshly (and for the first time) installed tslab. I get an error however when I go to use it:

unexpected error: TypeError: notifyUpdateSrc is not a function
    at updateContent (C:\nodejs\node_modules\tslab\dist\converter.js:533:9)
    at Object.convert (C:\nodejs\node_modules\tslab\dist\converter.js:188:9)
    at Object.execute (C:\nodejs\node_modules\tslab\dist\executor.js:140:32)
    at JupyterHandlerImpl.handleExecuteImpl (C:\nodejs\node_modules\tslab\dist\jupyter.js:205:38)
    at count.execQueue.add (C:\nodejs\node_modules\tslab\dist\jupyter.js:163:57)

To be clear, the kernel does start. this error occurs when trying to run anything. ie console.log('hello');

I'm running:

  • JupyterLab 1.2.4
  • Windows Server Core 1809
  • Python 3.7.6
  • NodeJS 10.16.3

If you need any more information, let me know!

How to read .js file?

Hi all,

is it enable to read .js file using tslab?
When I tried to read .js file(three.module.js) after uploading the file using tslab, fail to read it.

CodeMirror in Jupyter does not handle TypeScript

tslab kernel returns language_info.name == 'typescript' now.

But code-highlighting is not working on new cells in Jupyter notebook.

When I run CodeMirror.findModeByMIME('text/typescript'); in dev-console of Jupyter notebook window, it returns undefined though CodeMirror.findModeByMIME('text/javascript'); and CodeMirror.findModeByMIME('text/x-go'); return modes.
It looks like TypeScript mode is not available in Jupyter notebook now for some reason.

$ jupyter notebook --version
6.0.2
$ jupyter lab --version
1.2.2
$ CodeMirror.version (in dev-console)
"5.48.4"

This bug does not affect jupyter lab. In jupyter lab, ts-only keywords like interface are highlighted properly.

interface Hello {
    getMessage(): string;
}

Project-level installations of tslab have trouble finding imports

I installed the TypeScript kernel via tslab install --binary --sys-prefix. The kernel is able to run and execute TypeScript; however, it seems to have trouble finding imports.

$ npm install --save-dev tslab @types/node
[…]
$ ./node_modules/tslab/bin/tslab install --binary "./node_modules/tslab/bin/tslab" --sys-prefix
Running python3 /[…]/node_modules/tslab/python/install.py --tslab=./node_modules/tslab/bin/tslab --sys-prefix
Installing TypeScript kernel spec
Installing JavaScript kernel spec

While the local installation of tslab is not directly available in my global PATH, conferring it via the --binary flag certainly works for executing TypeScript. Would the issue be related to the binary not being included in my PATH even though the binary is configured correctly?

yarn test displays a warning: Jest did not exit one second after the test run has completed.

How to reproduce

yarn test

Problem

Jest did not exit one second after the test run has completed.

This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.

Background
I started to see this on Mac/Linux since 7ffa307.
We don't see this warning on travis CI: https://travis-ci.org/yunabe/tslab/builds/588461578

Solution

With --runInBand option, this warning disapears.

TSLab doesn't seem to correctly infer types of method calls

I have library with the following method signature:

const sessionValidators = await api.query.session.validators()

If I were to try to run the following code:

sessionValidators.forEach((validator) => console.log(validator.toHuman()))

TSLab gives the following error:
1:19 - Property 'forEach' does not exist on type 'unknown'.

While that same code compiles and runs fine locally.

To fix in TSLab, I have to do the following:

(sessionValidators as Vec<ValidatorId>).forEach((validator) => console.log(validator.toHuman()))

Is there a way to allow TSLab to infer the types of constants from method calls, using the method call signature?

Otherwise, it makes it difficult to import code from my project for interactive usage, having to explicitly type all variables.

Slow code execution by vm.runInContext

The execution of code below is slower than Python.

function naiveFib(n: number): number {
    if (n > 1) {
        return naiveFib(n - 1) + naiveFib(n - 2);
    }
    return 1;
}
naiveFib(40);

According to Performance section of this blog:

To avoid this, wrap scripts that you run using runInContext or runInNewContext in a immediately-invoked function expression (IIFE).

we should wrap code with function(){...} for some reason to improve the performance.

Also, the implementation of require in Node.js wraps code with function(){...} and run it with vm.runInThisContext internally (reference). Thus, it seems like we also need to wrap code with function(){...} though I don't understand the exact reason.

Disallow definitions of variable with require or exports names

To bypass #1, tslab converts (1) TypeScript into ES2015 module JS with TS compiler, (2) then convert it into CommonJS module JS.

In (1), TypeScript does not check the colisions with require and exports because the output module is ES2015 (See checkCollisionWithRequireExportsInGeneratedCode in checker.ts of TypeScript). In (2), ts.transpile does not check anything.

Thus, tslab does not detect the colisions with require and exports in the current implementation.

[Breaking Bug] Changing 1 argument in kernel.json to support Hydrogen

tslab works for me at jupyter-notebok.
I haven't test for jupyter-lab but i think it will work.

What I am working with is called hydrogen
Which is an environment that uses jupyter kernel interfaces to support live code output displaying in the text editor atom by Github.

So the thing is the current generated kernel.json file is like this:

{
 "argv": [
   "tslab", 
   "kernel", 
   "--config-path={connection_file}",
   "--js"
  ], 
  "display_name": "JavaScript", 
  "language": "javascript"
}

Which will break as the string "--config-path={connection_file}" is not matched by jupyter client.

Changing it to this will fix the issue:

{
 "argv": [
   "tslab", 
   "kernel", 
   "--config-path",
   "{connection_file}",
   "--js"
  ], 
  "display_name": "JavaScript", 
  "language": "javascript"
}

The same thing should be done for TypeScript as well.


Note that this is not necessary to change as I believe the problem is with hydrogen.

But since this is an extremely simple fix, why not changing it to support other platform as well?

Especially there starts to have similar plugins for other text editors such as VScode.

Two solutions to draw charts & plots!

Is there any recommended way to output charts & plots?

I managed this using gnuplot but it feels quite hacky.

import * as tslab from "tslab";
import gnuplot from 'gnuplot';
async function plot(code:string) {
    const plot = gnuplot().println(code, {end:true});
    function streamToString (stream) {
        const chunks = [];
        return new Promise((resolve, reject) => {
            stream.on('data', (chunk) => chunks.push(chunk));
            stream.on('error', (err) => reject(err));
            stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
        })
    };
    const str = await streamToString(plot)
    tslab.display.html('<div style="width:100%">'+str as string+"</div>");
}

Usage:

image

[Enhancement] Adding logo to kernel spec

Show corresponding logo in Jupyter Notbook when using kernel.

I would like to see a simple enhancement of displaying JavaScript or TypeScript logo when using that kernel.

This is simple, I am already doing it at my computer myself.

Simply generate 2 files at the same directory as the kernel.config file ( the directory shown with jupyter kernelspec list ).

  • logo-32x32.png : a 32 by 32 png logo
  • logo-64x64.png : a 64 by 64 png logo

The logo are freely available:

There are no official logo for JavaScript.

The kernel crashes when same values are outputed repeatedly.

When we run:

for (let i = 0; i < 100; i++) {
    console.log('hello');
}

Jupyter server crashes with a message like:

[E 22:52:50.190 NotebookApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/Users/yunabe/Library/Python/3.7/lib/python/site-packages/zmq/eventloop/zmqstream.py", line 438, in _run_callback
        callback(*args, **kwargs)
      File "/Users/yunabe/Library/Python/3.7/lib/python/site-packages/zmq/eventloop/zmqstream.py", line 203, in <lambda>
        self.on_recv(lambda msg: callback(self, msg), copy=copy)
      File "/Users/yunabe/Library/Python/3.7/lib/python/site-packages/notebook/services/kernels/handlers.py", line 317, in _on_zmq_reply
        msg = self.session.deserialize(fed_msg_list)
      File "/Users/yunabe/Library/Python/3.7/lib/python/site-packages/jupyter_client/session.py", line 917, in deserialize
        raise ValueError("Duplicate Signature: %r" % signature)
    ValueError: Duplicate Signature: b'2ed8da8a1f68156aad0e03b0b5673fad2a099817f3846d03531450609b61d8e1'

Support Deepnote env

Hi @yunabe, we're trying to get this kernel up and running in Deepnote. The basics seem to be working well, but we have two remaining problems:

  1. Same as #48, tslab can't seem to be able to find installed dependencies (locally, globally, or via NODE_PATH). We falled back to require with absolute paths for now.
  2. Some installed dependencies are not importable if they use exports.
/work/node_modules/@amcharts/amcharts4/core.js:8
export { System, system } from "./.internal/core/System";
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:355:18)
    at wrapSafe (node:internal/modules/cjs/loader:1022:15)
    at Module._compile (node:internal/modules/cjs/loader:1056:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.apply (/opt/nvm/versions/node/v15.14.0/lib/node_modules/tslab/dist/executor.js:63:24)
    at evalmachine.<anonymous>:22:30

Feel free to check out or clone my project. If we make this work, using Deepnote, instead of binder for README and examples could be a bit faster.

Object literal ({}).constructor !== Object

For some reason, when running something like the following in a cell, checks for object literals no longer 'pass'.

const blah: { property: string } = { property: 'string'}
console.log(blah.constructor === Object)
console.log(blah.constructor)

// false
// [Function: Object]

Versus say:

const some = new Object()
console.log(some.constructor === Object)
console.log(some.constructor)

// true
// [Function: Object]

Normally, the first 'cell' above should also return true. Any idea why this is the case here? Does it have something to do with how the code is compiled to ES2015 on the fly? This behavior breaks some libraries that rely on object literal checks such as obj.contructor === Object. There are workarounds, but this is a pretty unexpected result.

Pending requets are not cancelled properly

When we run two cells like

throw new Error('failure');
console.log('hello');

the second cell does not abort properly.

The reason of this bug is the second request is not in this.taskQueue of JupyterHandlerImpl and it is executed after the queue resets.

Can not use named imported symbols

How to reproduce

  • Run

    import {join} from "path";
    
  • The, run

    join("a", "b");
    

Expected

path.join("a", "b") is executed.

Actual
An error like "Cannot read property 'join' of undefined"

Reasons

The first cell is converted into JS code like

const path_1 = require("path");,
exports.join = path_1.join;

and the second cell is converted into JS like:

path_1.join("a", "b");

But when the second converted cell is executed, path_1 is undefined because these two cells are executed as isolated modules.

Proposals

I think there are two solutions.

  1. Convert .ts file into ES2015 module JS. Then, execute it with Node vm module.
  2. Convert .ts file into ES2015 module JS. Types are checked in this phase.
    Then, convert the ES2015 module JS file into CommonJS module.

I decided to go with (2) becuase ES module support of vm module is still under experimental as of Sep, 2019.

Shell commands?

How do I run shell commands? I expected it to work like the python notepads do i.e.

! npm install some-package

Any advice?

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.