Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « walk-up-path « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 05524a6c055ebd3b07a2e7f9c2b733907f9b4499 (plain)
1
2
3
4
5
6
7
8
9
10
11
const {dirname, resolve} = require('path')
module.exports = function* (path) {
  for (path = resolve(path); path;) {
    yield path
    const pp = dirname(path)
    if (pp === path)
      path = null
    else
      path = pp
  }
}