# inquirer-directory

> a directory (relative to given path) selector for Inquirer.js

Latest version **2.2.0** (published 2019-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install inquirer-directory
pnpm add inquirer-directory
yarn add inquirer-directory
bun add inquirer-directory
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2019-07-20 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 335.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 43 |
| Author | Nick Randall |
| Maintainers | nicksrandall, seb |
| Keywords | Inquirer, directory, prompt |

## Links

- npm: https://www.npmjs.com/package/inquirer-directory
- Repository: https://github.com/nicksrandall/inquierer-directory
- Homepage: https://github.com/nicksrandall/inquierer-directory#readme
- Issues: https://github.com/nicksrandall/inquierer-directory/issues
- npm.io page: https://npm.io/package/inquirer-directory

## Dependencies (7)

- [util](https://npm.io/package/util.md) ^0.10.3
- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [figures](https://npm.io/package/figures.md) ^1.4.0
- [rx-lite](https://npm.io/package/rx-lite.md) ^4.0.8
- [inquirer](https://npm.io/package/inquirer.md) ^1.1.3
- [cli-cursor](https://npm.io/package/cli-cursor.md) ^1.0.2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2019-07-20
- 2.1.0 — 2016-11-08
- 2.0.0 — 2016-03-02
- 1.1.4 — 2016-01-28
- 1.1.3 — 2015-12-11
- 1.1.2 — 2015-12-11
- 1.1.1 — 2015-12-11
- 1.1.0 — 2015-12-10
- 1.0.1 — 2015-12-10

## README

# inquirer-directory

Relative Directory prompt for [inquirer](https://github.com/SBoudrias/Inquirer.js)

[![Build Status](https://travis-ci.org/nicksrandall/inquirer-directory.svg)](https://travis-ci.org/nicksrandall/inquirer-directory)

## Installation

```
npm install --save inquirer-directory
```

## Features
- Support for symlinked files
- Vim style navigation
- Search for file with "/" key

### Key Maps
- Press "/" key to enter search mode.
- Press "-" key to go up (back) a directory.

## Usage


This prompt is anonymous, meaning you can register this prompt with the type name you please:

```javascript
inquirer.registerPrompt('directory', require('inquirer-directory'));
inquirer.prompt({
  type: 'directory',
  ...
})
```

Change `directory` to whatever you might prefer.

### Options

Takes `type`, `name`, `message`, `basePath` properties.

See [inquirer](https://github.com/SBoudrias/Inquirer.js) readme for meaning of all except **basePath**.

**basePath** is the relative path from your current working directory

#### Example

```javascript
inquirer.registerPrompt('directory', require('inquirer-directory'));
inquirer.prompt([{
  type: 'directory',
  name: 'from',
  message: 'Where you like to put this component?',
  basePath: './src'
}]).then(function(answers) {
  // (answers.from is the path chosen)
});
```

[![asciicast](https://asciinema.org/a/31651.png)](https://asciinema.org/a/31651)

See also [example.js](https://github.com/nicksrandall/inquierer-directory/blob/master/example.js) for a working example

## License

MIT

---
_Source: https://npm.io/package/inquirer-directory · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
