https://github.com/nteract/jupyter-paths
:city_sunrise: Pure JavaScript implementation of jupyter --paths --json
https://github.com/nteract/jupyter-paths
Last synced: about 2 months ago
JSON representation
:city_sunrise: Pure JavaScript implementation of jupyter --paths --json
- Host: GitHub
- URL: https://github.com/nteract/jupyter-paths
- Owner: nteract
- License: bsd-3-clause
- Created: 2015-06-08T04:03:43.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2023-03-04T04:06:51.000Z (over 2 years ago)
- Last Synced: 2025-03-30T21:02:23.749Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 237 KB
- Stars: 9
- Watchers: 37
- Forks: 11
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jupyter-paths
[](https://nodei.co/npm/jupyter-paths/)
Pure JavaScript implementation of `jupyter-paths`.
```
npm install jupyter-paths
```## Usage
```JavaScript
$ node
> var jp = require('jupyter-paths')
```### `runtimeDir()`
Returns immediately with the path to running kernels
```JavaScript
> jp.runtimeDir()
'/Users/rgbkrk/Library/Jupyter/runtime'
```### `dataDirs()`
```JavaScript
> 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.```JavaScript
> jp.dataDirs({ withSysPrefix: true })
Promise { }
> jp.dataDirs({ withSysPrefix: true }).then(console.log)
Promise { }
> [ '/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.```JavaScript
> jp.configDirs({ withSysPrefix: true }).then(console.log)
Promise { }
> [ '/Users/rgbkrk/.jupyter',
'/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/etc/jupyter',
'/usr/local/etc/jupyter',
'/etc/jupyter' ]
```