Code Monkey home page Code Monkey logo

ijavascript's Introduction

IJavascript: A Javascript Kernel for IPython's Graphical Notebook

IJavascript is an npm package that implements a Javasript kernel for IPython's graphical notebook (also known as Jupyter). An IPython notebook combines the creation of rich-text documents (including mathematics, plots and videos) with the execution of code in a number of programming languages.

The execution of code is carried out by means of a kernel that implements the IPython messaging protocol. There are kernels available for Python, Julia, Ruby, Haskell and now Javascript.

IJavascript implements the latest stable specification of the protocol, version 4.1. This specification will be updated to version 5.0 in the next release of IPython.

A repository of IPython notebooks can be found here.

Prerequisites

The installation instructions of the prerequisites vary from platform to platform. In the Debian and Ubuntu distributions, it's enough to run the following command:

sudo apt-get install npm ipython ipython-notebook

For other platforms, instructions may be found at nodejs.org/download and ipython.org/install.

Installation

npm install ijavascript

Usage

To start an IPython notebook session with the Javascript kernel, simply run:

ijs

This command should open the IPython notebook dashboard in your default web browser:

Screenshot: IPython Notebook Dashboard

By default, the dashboard opens the notebooks in the current working folder. The command flag --notebook-dir=path/to/another/folder can be used to open the dashboard at a different folder:

ijs --notebook-dir=path/to/another/folder

Screenshot: IPython Notebook --notebook-dir

Here's a sample notebook that makes use of the Javascript kernel:

Screenshot: Notebook Hello Sample

By default, the Javascript kernel doesn't define global. If security is not a concern global can be enabled by passing the following command flag:

ijs --ijs-enable-global

Screenshot: Notebook global Sample

To obtain documentation for other command flags, run:

ipython notebook help

TO DO

  • Capture stdout and stdin of each Javascript session (this may require replacing vm with vm2).

  • Complete the implementation of IPython's messaging protocol.

ijavascript's People

Contributors

n-riesco avatar

Watchers

Min RK avatar James Cloos avatar  avatar

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.