# inquirer-level-select

> a level data selector for Inquirer.js

Latest version **1.0.1** (published 2017-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install inquirer-level-select
pnpm add inquirer-level-select
yarn add inquirer-level-select
bun add inquirer-level-select
```

## 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 | 1.0.1 |
| Published | 2017-11-27 |
| First published | 2017-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | gzlinguangyu |
| Maintainers | lgybetter |
| Keywords | Inquirer, level data, prompt |

## Links

- npm: https://www.npmjs.com/package/inquirer-level-select
- npm.io page: https://npm.io/package/inquirer-level-select

## Dependencies (8)

- [util](https://npm.io/package/util.md) ^0.10.3
- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [emojic](https://npm.io/package/emojic.md) ^1.1.12
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [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

- 1.0.1 (latest) — 2017-11-27

## README

## 层级结构数据终端选择交互命令

### Example

1. 具有层级结构数据传入格式

```json
{
  "result": [
    {
      "name": "channel",
      "title": "渠道",
      "type": 0,
      "children": [
        { 
          "name ": "order",
          "title": "订单",
          "children": [
            {
              "name": "list",
              "title": "列表",
              "children": [],
              "type": 1
            }
          ],
          "type": 0
        },
        {
          "name": "manage",
          "title": "管理",
          "children": [
          ],
          "type": 0
        },
        {
          "name": "manage2",
          "title": "管理2",
          "children": [
          ],
          "type": 1
        }
      ]
    },
    {
      "name": "distribu",
      "title": "分销",
      "type": 0,
      "children": []
    }
  ]
}

```

2. Prompt的注册调用

```js
const inquirer = require("inquirer")
const { result } = require("./config")
const { del: Prompt } = require('./index')
inquirer.registerPrompt('level', Prompt)

inquirer.prompt([
  {
    type: "level",
    name: "pathArr",
    message: "请选择",
    basePath: "./模块",
    data: result
  }
]).then(res => {
  console.log(res)
})


```

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