How to use the setPath function from app-root-path

Find comprehensive JavaScript app-root-path.setPath code examples handpicked from public code repositorys.

4
5
6
7
8
9
10
11
12
13
use: root.require,
ROOT_PATH: root,
PUBLIC_PATH: root.setPath('/public'),
STORAGE_PATH: root.setPath('/storage'),
APP_PATH: root.setPath('/src/app'),
CLASS_PATH: root.setPath('/src/class'),
CONFIG_PATH: root.setPath('/src/config'),
DATA_PATH: root.setPath('/src/data'),
DB_PATH: root.setPath('/src/db'),
HELPER_PATH: root.setPath('/src/helpers'),
fork icon0
star icon1
watch icon0

+ 21 other calls in file

9
10
11
12
13
14
15
16
17
18
19


try {
  if (checkForPkg(ROOT)) {
    appRootPath.setPath(ROOT)
    if (ROOT !== cwd && checkForPkg(cwd)) {
      appRootPath.setPath(cwd)
    }
  }
} catch (e) {
  log.warn('No package.json found at root of project', e)
fork icon0
star icon0
watch icon0

+ 3 other calls in file