0.5.80 • Published 2 years ago

jupnode v0.5.80

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

jupnode

Jupnode lib for enable a Jupyter Notebook user to invoke Node.js commands.

Screenshot: Notebook Hello Sample

Prerequisites

You need Node.js/npm installed. See the Node.js downloads page to find an installer for your platform.

Using

After this cell other cells will run on node.js.

!npm i jupnode
import jupnode

Use %%py for use python in cell

%%py
print(123)
print(54)

You can use await in top level

fs = require("fs");
await fs.promises.readFile("example.txt");

Use var for global usage. Use let, const variables for local usage in cell

var globalVar = 1;
let variableInCell = 2;
console.log(globalVar, variableInCell);
// 1 2
// 1
console.log(globalVar);
console.log(variableInCell);
// ReferenceError: variableInCell is not defined

Use "sh" global function for system operations

//install npm package
sh("npm i @tensorflow/tfjs-node");
//or
sh`npm i @tensorflow/tfjs-node`;

//download file
let folder = "./";
sh`wget -nv http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar -P ${folder}/`;

Formatted output

Use "html" or "image" functions for formatted output

//show html
html(`<p>This is html</p>`);

//show image base64
image("data:image/jpeg;base64, LzlqLzRBQ...<!-- base64 data -->");

//show image url
image("https://kstatic.googleusercontent.com/...");
0.5.80

2 years ago

0.5.73

3 years ago

0.5.23

3 years ago

0.5.22

3 years ago

0.6.0

3 years ago

0.5.21

3 years ago

0.5.19

3 years ago

0.5.18

3 years ago

0.5.17

3 years ago

0.5.16

3 years ago

0.5.15

3 years ago

0.5.14

3 years ago

0.4.13-test

3 years ago

0.5.13

3 years ago

0.5.12

3 years ago

0.5.11

3 years ago

0.5.9

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago