5.0.1 • Published 4 years ago

spawnteract v5.0.1

Weekly downloads
2,668
License
BSD-3-Clause
Repository
github
Last release
4 years ago

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.

5.0.1

4 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.0.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.1

7 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago