1.0.1 • Published 6 months ago

find-in-directory v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

find-in-directory

Build Status Coverage Npm Version MIT License

Find file or directory by names in a directory.

Install

yarn add find-in-directory

Usage

import {findFile, findDirectory} from 'find-in-directory'

const file = await findFile(process.cwd(), [
  'package.json',
  'package.json5',
  'package.yaml',
])

// "/path/to/package.json"

API

{findFile, findDirectory}(directory, nameOrNames, predicate?, options?)

directory

The directory to find.

Type: URL | string

nameOrNames

The file/directory name or names to find.

Type: string[] | string

predicate

Type: (path: string) => Promise<boolean>

options

options.allowSymlinks

Should allow symlinks or not.

Type: boolean

1.0.1

6 months ago

1.0.0

6 months ago