PHP 8.2.30
Preview: index.js Size: 659 B
/home/byroehnu/easepay.easetack.com/node_modules/find-root/index.js

var path = require('path')
var fs = require('fs')

function defaultCheck (dir) {
  return fs.existsSync(path.join(dir, 'package.json'))
}

function findRoot (start, check) {
  start = start || module.parent.filename
  check = check || defaultCheck

  if (typeof start === 'string') {
    if (start[start.length - 1] !== path.sep) {
      start += path.sep
    }
    start = start.split(path.sep)
  }
  if (!start.length) {
    throw new Error('package.json not found in path')
  }
  start.pop()
  var dir = start.join(path.sep)
  try {
    if (check(dir)) {
      return dir
    }
  } catch (e) {}
  return findRoot(start, check)
}

module.exports = findRoot

Directory Contents

Dirs: 1 × Files: 7

Name Size Perms Modified Actions
test DIR
- drwxr-xr-x 2026-03-14 01:49:21
Edit Download
127 B lr--r--r-- 2026-03-14 01:49:21
Edit Download
23 B lrw-r--r-- 2026-02-28 00:26:42
Edit Download
95 B lrw-r--r-- 2026-02-28 00:27:12
Edit Download
659 B lrw-r--r-- 2026-02-28 00:27:02
Edit Download
1.03 KB lrw-r--r-- 2026-02-28 00:27:22
Edit Download
560 B lrw-r--r-- 2026-02-28 00:26:32
Edit Download
1.59 KB lrw-r--r-- 2026-02-28 00:26:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).