Skip to content

mathisonian/spawnteract

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spawnteract

Spawn yourself a Jupyter kernel backend.

npm install --save spawnteract

Usage

const spawnteract = require('spawnteract')

spawnteract.launch('python3').then(kernel => {
  // Returns
  // kernel.spawn <-- The running process, from child_process.spawn(...)
  // kernel.connectionFile <-- Connection file path
  // kernel.config <-- Connection information from the file

  // Print the ip address and port for the shell channel
   console.log(kernel.config.ip + ':' + kernel.config.shell_port);
})

You'll need to close kernel.spawn yourself as well as delete kernel.connectionFile from disk when finished:

function cleanup(kernel) {
  kernel.spawn.kill();
  fs.unlink(kernel.connectionFile);
}

You will probably end up wanting to use this with enchannel-zmq-backend.

About

🚸 Spawn Jupyter Kernels

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%