spawnteract

5.0.1 • Public • Published

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);
})

spawnteract will automatically delete the connection file after the kernel process exits or errors out.

To disable this feature, set cleanupConnectionFile to false in the spawnOptions:

launch(kernelName, { cleanupConnectionFile: false });

You'll should close kernel.spawn when a user shuts down the kernel. If you disabled automatic cleanup, you will need to delete kernel.connectionFile from disk when finished:

function cleanup(kernel) {
  kernel.spawn.kill();
  // Only do this second part if you opted out of automatic cleanup:
  fs.unlink(kernel.connectionFile);
}

For more info, see our changelog or open an issue with questions

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.0.126latest

Version History

VersionDownloads (Last 7 Days)Published
5.0.126
5.1.012
5.0.00
4.0.01
3.1.00
3.0.00
2.2.11
2.2.00
2.1.10
2.1.00
2.0.00
1.0.30
1.0.20
1.0.10
1.0.00
0.1.00
0.0.41
0.0.31
0.0.20
0.0.13

Package Sidebar

Install

npm i spawnteract

Weekly Downloads

40

Version

5.0.1

License

BSD-3-Clause

Unpacked Size

14.6 kB

Total Files

7

Last publish

Collaborators

  • hydrosquall
  • benabel
  • alexandercbooth
  • benrussert
  • mpacer
  • theengineear
  • yuvipanda
  • rgbkrk
  • lgeiger
  • ivanov
  • captainsafia
  • peggyrayzis
  • jdetle
  • hasch
  • willingc
  • stormpython
  • crystalline-cat
  • emeeks
  • jdfreder