1.1.0 • Published 9 years ago
jupyter-runtimes v1.1.0
jupyter-runtimes
Watches jupyter runtime files for you.
var Runtimes = require('jupyter-runtimes')
var watcher = Runtimes(['/path/to/runtime/dir'])
watcher.on('data', function (runtimes) {
// runtimes is a list of the contents of each runtime as a JSON object
// e.g. [
// {
// "filepath": "/path/to/runtimes/ajsdfhd-runtime.json",
// "data": {etc..}
// }
// ]
//
})
watcher.close()
API
Runtimes(dirs)
Returns a watcher
dirs
: the directories to watch
watcher.close()
Closes the watcher -- stops watching the filesystem.
Events
There should be more, but right now it just emits one event -- that's when the kernel spec (kernel.json
) has changed.
data
watcher.on('data', function (runtimes) {
// list of runtimes
})