1.0.0 • Published 5 years ago

get-file-path v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

get-file-path

Retrieve a file path from an initial path. A common example is to get the path of a package.json.

How it works? If the file isn't at the initial path, it will search in the parent folder, etc.

Installation

npm i get-file-path

Usage

getFilePath(initialPath, fileToReach)

By default fileToReach is package.json

e.g

import getFilePath from "get-file-path"

const packagePath = getFilePath("./", "package.json")

// packagePath: '/Users/username/Desktop/getFile/package.json'

License

get-file-path is MIT-licensed.