Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ysuzuki19/dir-finder

TypeScript Library for finding directory
https://github.com/ysuzuki19/dir-finder

Last synced: 2 days ago
JSON representation

TypeScript Library for finding directory

Awesome Lists containing this project

README

        

# dir-finder

TypeScript Library for finding directory.

By this library, you can find git/node root easily in your code.😉

# install

```bash
$ npm i dir-finder
```

# How to use

## Find git root

function find by `.git` existing

```typescript
import { find_git_root } from './index';

// find git root
const res = find_git_root(__dirname);
```

## Find node root

function find by `node_modules` existing

```typescript
import { find_git_root } from './index';

// find node root
const res = find_node_root(__dirname);
```