Skip to content

timepp/rootdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rootdir

This utility helps you find the root directory of a project from any subdirectory within it. It searches for .git by default, but you can customize the search criteria.

Supposing you have the following project structure:

/foo/bar/project/
  - src/
    - components/
      - handlers/
        - tools.ts
  - .git/
  - package.json

And in tools.ts:

import * as rd from 'jsr:@timepp/rootdir'
...
const rootDir = rd.findRootDir()
// rootDir will be '/foo/bar/project'

About

find root dir by different algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors