jupyter-paths
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

jupyter-paths

NPM

Travis for Jupyter Paths Build status Greenkeeper badge

Pure JavaScript implementation of jupyter-paths.

npm install jupyter-paths

Usage

$ node
> var jp = require('jupyter-paths')

runtimeDir()

Returns immediately with the path to running kernels

> jp.runtimeDir()
'/Users/rgbkrk/Library/Jupyter/runtime'

dataDirs()

> jp.dataDirs()
[ '/Users/rgbkrk/Library/Jupyter',
  '/usr/share/jupyter',
  '/usr/local/share/jupyter' ]

If you want the paths to include the sys.prefix paths (for Anaconda installs), an optional opts parameter is accepted with key withSysPrefix. This changes the return to a promise for you instead.

> jp.dataDirs({ withSysPrefix: true })
Promise { <pending> }
> jp.dataDirs({ withSysPrefix: true }).then(console.log)
Promise { <pending> }
> [ '/Users/rgbkrk/Library/Jupyter',
  '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/share/jupyter',
  '/usr/share/jupyter',
  '/usr/local/share/jupyter' ]

configDirs()

Like dataDirs, an optional opts parameter is accepted with key withSysPrefix as an argument.

> jp.configDirs({ withSysPrefix: true }).then(console.log)
Promise { <pending> }
> [ '/Users/rgbkrk/.jupyter',
  '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/etc/jupyter',
  '/usr/local/etc/jupyter',
  '/etc/jupyter' ]

Readme

Keywords

Package Sidebar

Install

npm i jupyter-paths

Weekly Downloads

236

Version

2.0.4

License

BSD-3-Clause

Unpacked Size

18.2 kB

Total Files

9

Last publish

Collaborators

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