GithubHelp home page GithubHelp logo

aghz / ijavascript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n-riesco/ijavascript

0.0 2.0 0.0 228 KB

IJavascript is a javascript kernel for IPython's graphical notebook

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

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 many others.

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 prerequisites vary from platform to platform.

Debian and Ubuntu

In recent Debian and Ubuntu distributions, it's enough to run the following command:

sudo apt-get install nodejs-legacy npm ipython ipython-notebook libzmq-dev

Ubuntu 12.04

In Ubuntu 12.04, both node.js and ipython need upgrading to a recent version:

sudo apt-get install libzmq-dev python-dev python-pip g++ curl
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
sudo pip install --upgrade ipython jinja2 tornado jsonschema pyzmq

The instructions for upgrading node.js have been adapted from those found here.

Other Platforms

For other platforms, instructions may be found at nodejs.org/download, ipython.org/install and zeromq.org/intro:get-the-software.

Installation

To install IJavascript globally (i.e. for all users in the system), run:

sudo npm install -g ijavascript

To install locally, run:

npm install ijavascript

In Debian and Ubuntu distributions, the above command will install the executable ijs in the folder ~/node_modules/.bin/. You may want to add this folder to your PATH:

echo \"PATH=\"\$HOME/node_modules/.bin\" >> ~/.profile

Note that the above change won't take effect until you log out of the current session.

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 minrk avatar

Watchers

Adrian Ghizaru avatar James Cloos 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.